Java 类com.intellij.psi.impl.source.xml.XmlFileImpl 实例源码

项目:ADB-Duang    文件:PushAction.java   
@Override
protected boolean runEnable(AnActionEvent anActionEvent) {
    Object o = anActionEvent.getDataContext().getData(DataConstants.PSI_FILE);
    if (o instanceof XmlFileImpl) {
        parentFileName = ((XmlFileImpl) o).getVirtualFile().getParent().getName();
        if (isPreference(parentFileName)) {
            return true;
        }

    } else if (o instanceof PsiFile) {
        parentFileName = ((PsiFile) o).getVirtualFile().getParent().getName();
        if (isDataBase(parentFileName)) {
            return true;
        }
    }
    return false;
}
项目:ADB-Duang    文件:PushAction.java   
@Override
protected String getAndroidFacetName(AnActionEvent anActionEvent) {
    Object o = anActionEvent.getDataContext().getData(DataConstants.PSI_FILE);
    if (o instanceof XmlFileImpl) {

        return ((XmlFileImpl) o).getVirtualFile().getParent().getParent().getName();

    } else if (o instanceof PsiFile) {
        return parentFileName = ((PsiFile) o).getVirtualFile().getParent().getParent().getName();
    }
    return super.getAndroidFacetName(anActionEvent);
}
项目:intellij-ce-playground    文件:XmlReparseTest.java   
public void test1() throws Exception{
  String s1 = "<a>";
  String s2 = "</a>";

  prepareFile(s1, s2);
  final String beforeReparse = DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true);
  insert("");
  assertEquals("Tree changed after empty reparse", beforeReparse, DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true));
}
项目:tools-idea    文件:XmlReparseTest.java   
public void test1() throws Exception{
  String s1 = "<a>";
  String s2 = "</a>";

  prepareFile(s1, s2);
  final String beforeReparse = DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true);
  insert("");
  assertEquals("Tree changed after empty reparse", beforeReparse, DebugUtil.treeToString(((XmlFileImpl)myDummyFile).getTreeElement(), true));
}
项目:WebStormRequireJsPlugin    文件:RequirejsProjectComponent.java   
public boolean parseRequirejsConfig() {
    VirtualFile mainJsVirtualFile = findPathInWebDir(settings.configFilePath);
    if (null == mainJsVirtualFile) {
        this.showErrorConfigNotification("Config file not found. File " + settings.publicPath + '/' + settings.configFilePath + " not found in project");
        LOG.debug("Config not found");
        return false;
    } else {
        PsiFile mainJs = PsiManager.getInstance(project).findFile(mainJsVirtualFile);
        if (mainJs instanceof JSFileImpl || mainJs instanceof XmlFileImpl) {
            Map<String, VirtualFile> allConfigPaths;
            packageConfig.clear();
            requireMap.clear();
            requirePaths.clear();
            if (((PsiFileImpl) mainJs).getTreeElement() == null) {
                parseMainJsFile(((PsiFileImpl) mainJs).calcTreeElement());
            } else {
                parseMainJsFile(((PsiFileImpl) mainJs).getTreeElement());
            }
        } else {
            this.showErrorConfigNotification("Config file wrong format");
            LOG.debug("Config file wrong format");
            return false;
        }
    }

    return true;
}
项目:intellij-ce-playground    文件:DTDParserDefinition.java   
@Override
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.DTD_FILE);
}
项目:intellij-ce-playground    文件:XHTMLParserDefinition.java   
@Override
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.XHTML_FILE);
}
项目:intellij-ce-playground    文件:XMLParserDefinition.java   
@Override
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.XML_FILE);
}
项目:intellij-ce-playground    文件:XmlFormatterTestBase.java   
protected void checkFormattingDoesNotProduceException(String name) throws Exception {

    String text = loadFile(name + ".xml", null);
    final XmlFileImpl file = (XmlFileImpl)createFile(name + ".xml", text);
    myTextRange = new TextRange(10000, 10001);
    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            performFormatting(file);
          }
        });
      }
    }, "", "");

    myTextRange = new TextRange(1000000, 1000001);
    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            performFormatting(file);
          }
        });
      }
    }, "", "");
    myTextRange = new TextRange(0, text.length());
    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            performFormatting(file);
          }
        });
      }
    }, "", "");
  }
项目:tools-idea    文件:DTDParserDefinition.java   
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.DTD_FILE);
}
项目:tools-idea    文件:XHTMLParserDefinition.java   
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.XHTML_FILE);
}
项目:tools-idea    文件:XMLParserDefinition.java   
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.XML_FILE);
}
项目:tools-idea    文件:XmlFormatterTestBase.java   
protected void checkFormattingDoesNotProduceException(String name) throws Exception {

    String text = loadFile(name + ".xml", null);
    final XmlFileImpl file = (XmlFileImpl)createFile(name + ".xml", text);
    myTextRange = new TextRange(10000, 10001);
    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            performFormatting(file);
          }
        });
      }
    }, "", "");

    myTextRange = new TextRange(1000000, 1000001);
    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            performFormatting(file);
          }
        });
      }
    }, "", "");
    myTextRange = new TextRange(0, text.length());
    CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          @Override
          public void run() {
            performFormatting(file);
          }
        });
      }
    }, "", "");
  }
项目:consulo-xml    文件:XMLParserDefinition.java   
@Override
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.XML_FILE);
}
项目:consulo-xml    文件:DTDParserDefinition.java   
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.DTD_FILE);
}
项目:consulo-xml    文件:XHTMLParserDefinition.java   
@Override
public PsiFile createFile(FileViewProvider viewProvider) {
  return new XmlFileImpl(viewProvider, XmlElementType.XHTML_FILE);
}