PY-13986 View -> Open In Browser unavailable for Django projects

Refactored: useless iface HtmlCompatibleLanguage removed due to Krivosheev request: UrlProvider is now used.
This commit is contained in:
Ilya.Kazakevich
2014-12-23 21:50:04 +03:00
parent ca03441fcb
commit d3c52d849d
5 changed files with 7 additions and 37 deletions
@@ -117,9 +117,7 @@ public class Utils{
actionManager,
0
);
if (!doUpdate(group, e, presentation)) {
return;
}
if (!doUpdate(group, e, presentation)) return;
if (!presentation.isVisible()) { // don't process invisible groups
return;
@@ -138,9 +136,7 @@ public class Utils{
e1.setInjectedContext(child.isInInjectedContext());
if (transparentOnly && child.isTransparentUpdate() || !transparentOnly) {
if (!doUpdate(child, e1, presentation)) {
continue;
}
if (!doUpdate(child, e1, presentation)) continue;
}
if (!presentation.isVisible() || (!presentation.isEnabled() && hideDisabled)) { // don't create invisible items in the menu
@@ -180,7 +176,6 @@ public class Utils{
list.add(child);
}
}
int i = 1;
}
// returns false if exception was thrown and handled
@@ -1,23 +1,22 @@
package com.jetbrains.python.templateLanguages;
import com.intellij.lang.Language;
import com.intellij.openapi.module.Module;
import com.intellij.psi.templateLanguages.TemplateLanguage;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* TODO: Make this class implemeent {@link com.intellij.lang.html.HtmlCompatibleLanguage} to prevent copy/paste by fixing dependencies
* Python template language
*
* @author Ilya.Kazakevich
*/
public abstract class PythonTemplateLanguage extends Language implements TemplateLanguage {
protected PythonTemplateLanguage(@Nullable final Language baseLanguage,
@NotNull @NonNls final String ID,
@NotNull @NonNls final String... mimeTypes) {
@NotNull @NonNls final String ID,
@NotNull @NonNls final String... mimeTypes) {
super(baseLanguage, ID, mimeTypes);
}
@@ -20,7 +20,6 @@ import com.intellij.ide.browsers.WebBrowserService;
import com.intellij.ide.browsers.WebBrowserUrlProvider;
import com.intellij.lang.Language;
import com.intellij.lang.html.HTMLLanguage;
import com.intellij.lang.html.HtmlCompatibleLanguage;
import com.intellij.lang.xhtml.XHTMLLanguage;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.project.DumbService;
@@ -39,7 +38,7 @@ import java.util.Collections;
public class WebBrowserServiceImpl extends WebBrowserService {
public static boolean isHtmlOrXmlFile(@NotNull Language language) {
return language instanceof HtmlCompatibleLanguage || language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE || language == XMLLanguage.INSTANCE;
return language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE || language == XMLLanguage.INSTANCE;
}
@NotNull
@@ -20,7 +20,7 @@ import com.intellij.lang.xml.XMLLanguage;
/**
* @author max
*/
public class HTMLLanguage extends XMLLanguage implements HtmlCompatibleLanguage {
public class HTMLLanguage extends XMLLanguage {
public static final HTMLLanguage INSTANCE = new HTMLLanguage();
@@ -1,23 +0,0 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.lang.html;
/**
* Language that is based on HTML (like some template languages)
* @author Ilya.Kazakevich
*/
public interface HtmlCompatibleLanguage {
}