mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
built-in server module — get rid of xml module dependency
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
<orderEntry type="module" module-name="platform-impl" />
|
||||
<orderEntry type="library" name="Netty" level="project" />
|
||||
<orderEntry type="module" module-name="xml-openapi" />
|
||||
<orderEntry type="module" module-name="xml" />
|
||||
<orderEntry type="module" module-name="xdebugger-api" />
|
||||
<orderEntry type="library" name="Guava" level="project" />
|
||||
<orderEntry type="library" name="gson" level="project" />
|
||||
|
||||
+17
-2
@@ -1,8 +1,23 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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 org.jetbrains.builtInWebServer;
|
||||
|
||||
import com.intellij.ide.browsers.OpenInBrowserRequest;
|
||||
import com.intellij.ide.browsers.WebBrowserService;
|
||||
import com.intellij.ide.browsers.WebBrowserUrlProvider;
|
||||
import com.intellij.ide.browsers.impl.WebBrowserServiceImpl;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -78,7 +93,7 @@ public class BuiltInWebBrowserUrlProvider extends WebBrowserUrlProvider implemen
|
||||
}
|
||||
|
||||
protected boolean isMyLanguage(@NotNull Language language) {
|
||||
return WebBrowserServiceImpl.isHtmlOrXmlFile(language);
|
||||
return WebBrowserService.isHtmlOrXmlFile(language);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-204 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -18,9 +18,6 @@ package com.intellij.ide.browsers.impl;
|
||||
import com.intellij.ide.browsers.OpenInBrowserRequest;
|
||||
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.xhtml.XHTMLLanguage;
|
||||
import com.intellij.lang.xml.XMLLanguage;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -37,10 +34,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class WebBrowserServiceImpl extends WebBrowserService {
|
||||
public static boolean isHtmlOrXmlFile(@NotNull Language language) {
|
||||
return language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE || language == XMLLanguage.INSTANCE;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<Url> getUrlsToOpen(@NotNull OpenInBrowserRequest request, boolean preferLocalUrl) throws WebBrowserUrlProvider.BrowserException {
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
*/
|
||||
package com.intellij.ide.browsers;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.html.HTMLLanguage;
|
||||
import com.intellij.lang.xhtml.XHTMLLanguage;
|
||||
import com.intellij.lang.xml.XMLLanguage;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.Url;
|
||||
@@ -38,4 +42,8 @@ public abstract class WebBrowserService {
|
||||
OpenInBrowserRequest request = OpenInBrowserRequest.create(element);
|
||||
return request == null ? Collections.<Url>emptyList() : getUrlsToOpen(request, preferLocalUrl);
|
||||
}
|
||||
|
||||
public static boolean isHtmlOrXmlFile(@NotNull Language language) {
|
||||
return language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE || language == XMLLanguage.INSTANCE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user