mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
OC-662
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.intellij.util.xml.impl;
|
||||
|
||||
import com.intellij.ide.highlighter.DomSupportEnabled;
|
||||
import com.intellij.ide.startup.StartupManagerEx;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
@@ -337,7 +338,7 @@ public final class DomManagerImpl extends DomManager {
|
||||
@Nullable
|
||||
public final <T extends DomElement> DomFileElementImpl<T> getFileElement(XmlFile file) {
|
||||
if (file == null) return null;
|
||||
if (!StdFileTypes.XML.equals(file.getFileType())) return null;
|
||||
if (file.getFileType() instanceof DomSupportEnabled) return null;
|
||||
final VirtualFile virtualFile = file.getVirtualFile();
|
||||
if (virtualFile != null && virtualFile.isDirectory()) return null;
|
||||
return this.<T>getOrCreateCachedValueProvider(file).getFileElement();
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2000-2011 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.ide.highlighter;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* User: zajac
|
||||
* Date: 15.04.11
|
||||
* Time: 14:57
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public interface DomSupportEnabled {
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class XmlFileType extends XmlLikeFileType {
|
||||
public class XmlFileType extends XmlLikeFileType implements DomSupportEnabled {
|
||||
public static final XmlFileType INSTANCE = new XmlFileType();
|
||||
@NonNls public static final String DEFAULT_EXTENSION = "xml";
|
||||
@NonNls public static final String DOT_DEFAULT_EXTENSION = "."+DEFAULT_EXTENSION;
|
||||
|
||||
Reference in New Issue
Block a user