Java 类com.intellij.lang.ant.dom.AntDomFileDescription 实例源码

项目:intellij-ce-playground    文件:AntConfigurationImpl.java   
private AntBuildFileBase addBuildFileImpl(final VirtualFile file) throws AntNoFileException {
  PsiFile xmlFile = myPsiManager.findFile(file);
  if (!(xmlFile instanceof XmlFile)) {
    throw new AntNoFileException("the file is not an xml file", file);
  }
  AntSupport.markFileAsAntFile(file, xmlFile.getProject(), true);
  if (!AntDomFileDescription.isAntFile(((XmlFile)xmlFile))) {
    throw new AntNoFileException("the file is not recognized as an ANT file", file);
  }
  final AntBuildFileImpl buildFile = new AntBuildFileImpl((XmlFile)xmlFile, this);
  synchronized (myBuildFiles) {
    myBuildFilesArray = null;
    myBuildFiles.add(buildFile);
  }
  return buildFile;
}
项目:intellij-ce-playground    文件:AntConfigurationImpl.java   
@Nullable
public XmlFile getContextFile(@Nullable final XmlFile file) {
  if (file == null) {
    return null;
  }
  final VirtualFile context = myAntFileToContextFileMap.get(file.getVirtualFile());
  if (context == null) {
    return null;
  }
  final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(context);
  if (!(psiFile instanceof XmlFile)) {
    return null;
  }
  final XmlFile xmlFile = (XmlFile)psiFile;
  return AntDomFileDescription.isAntFile(xmlFile)? xmlFile : null;
}
项目:tools-idea    文件:AntConfigurationImpl.java   
private AntBuildFileBase addBuildFileImpl(final VirtualFile file) throws AntNoFileException {
  PsiFile xmlFile = myPsiManager.findFile(file);
  if (!(xmlFile instanceof XmlFile)) {
    throw new AntNoFileException("the file is not an xml file", file);
  }
  AntSupport.markFileAsAntFile(file, xmlFile.getProject(), true);
  if (!AntDomFileDescription.isAntFile(((XmlFile)xmlFile))) {
    throw new AntNoFileException("the file is not recognized as an ANT file", file);
  }
  final AntBuildFileImpl buildFile = new AntBuildFileImpl((XmlFile)xmlFile, this);
  synchronized (myBuildFiles) {
    myBuildFilesArray = null;
    myBuildFiles.add(buildFile);
  }
  return buildFile;
}
项目:tools-idea    文件:AntConfigurationImpl.java   
@Nullable
public XmlFile getContextFile(@Nullable final XmlFile file) {
  if (file == null) {
    return null;
  }
  final VirtualFile context = myAntFileToContextFileMap.get(file.getVirtualFile());
  if (context == null) {
    return null;
  }
  final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(context);
  if (!(psiFile instanceof XmlFile)) {
    return null;
  }
  final XmlFile xmlFile = (XmlFile)psiFile;
  return AntDomFileDescription.isAntFile(xmlFile)? xmlFile : null;
}
项目:consulo-apache-ant    文件:AntConfigurationImpl.java   
private AntBuildFileBase addBuildFileImpl(final VirtualFile file) throws AntNoFileException {
  PsiFile xmlFile = myPsiManager.findFile(file);
  if (!(xmlFile instanceof XmlFile)) {
    throw new AntNoFileException("the file is not an xml file", file);
  }
  AntSupport.markFileAsAntFile(file, xmlFile.getProject(), true);
  if (!AntDomFileDescription.isAntFile(((XmlFile)xmlFile))) {
    throw new AntNoFileException("the file is not recognized as an ANT file", file);
  }
  final AntBuildFileImpl buildFile = new AntBuildFileImpl((XmlFile)xmlFile, this);
  synchronized (myBuildFiles) {
    myBuildFilesArray = null;
    myBuildFiles.add(buildFile);
  }
  return buildFile;
}
项目:consulo-apache-ant    文件:AntConfigurationImpl.java   
@Nullable
public XmlFile getContextFile(@Nullable final XmlFile file) {
  if (file == null) {
    return null;
  }
  final VirtualFile context = myAntFileToContextFileMap.get(file.getVirtualFile());
  if (context == null) {
    return null;
  }
  final PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(context);
  if (!(psiFile instanceof XmlFile)) {
    return null;
  }
  final XmlFile xmlFile = (XmlFile)psiFile;
  return AntDomFileDescription.isAntFile(xmlFile)? xmlFile : null;
}
项目:intellij-ce-playground    文件:AntBuildFileImpl.java   
@Nullable
public XmlFile getAntFile() {
  final PsiFile psiFile = myVFile.isValid() ? PsiManager.getInstance(getProject()).findFile(myVFile) : null;
  if (!(psiFile instanceof XmlFile)) {
    return null;
  }
  final XmlFile xmlFile = (XmlFile)psiFile;
  return AntDomFileDescription.isAntFile(xmlFile) ? xmlFile : null;
}
项目:intellij-ce-playground    文件:AntRenameHandler.java   
@Nullable 
private static PsiElement[] getElements(DataContext dataContext) {
  final PsiFile psiFile = CommonDataKeys.PSI_FILE.getData(dataContext);
  if (!(psiFile instanceof XmlFile && AntDomFileDescription.isAntFile((XmlFile)psiFile))) {
    return null;
  }
  final Editor editor = LangDataKeys.EDITOR.getData(dataContext);
  if (editor == null) {
    return null;
  }
  return getPsiElementsIn(editor, psiFile);
}
项目:tools-idea    文件:AntBuildFileImpl.java   
@Nullable
public XmlFile getAntFile() {
  final PsiFile psiFile = myVFile.isValid() ? PsiManager.getInstance(getProject()).findFile(myVFile) : null;
  if (!(psiFile instanceof XmlFile)) {
    return null;
  }
  final XmlFile xmlFile = (XmlFile)psiFile;
  return AntDomFileDescription.isAntFile(xmlFile) ? xmlFile : null;
}
项目:tools-idea    文件:AntRenameHandler.java   
@Nullable 
private static PsiElement[] getElements(DataContext dataContext) {
  final PsiFile psiFile = LangDataKeys.PSI_FILE.getData(dataContext);
  if (!(psiFile instanceof XmlFile && AntDomFileDescription.isAntFile((XmlFile)psiFile))) {
    return null;
  }
  final Editor editor = LangDataKeys.EDITOR.getData(dataContext);
  if (editor == null) {
    return null;
  }
  return getPsiElementsIn(editor, psiFile);
}
项目:consulo-apache-ant    文件:AntBuildFileImpl.java   
@Override
@Nullable
public XmlFile getAntFile()
{
    final PsiFile psiFile = myVFile.isValid() ? PsiManager.getInstance(getProject()).findFile(myVFile) : null;
    if(!(psiFile instanceof XmlFile))
    {
        return null;
    }
    final XmlFile xmlFile = (XmlFile) psiFile;
    return AntDomFileDescription.isAntFile(xmlFile) ? xmlFile : null;
}
项目:consulo-apache-ant    文件:AntRenameHandler.java   
@Nullable 
private static PsiElement[] getElements(DataContext dataContext) {
  final PsiFile psiFile = dataContext.getData(LangDataKeys.PSI_FILE);
  if (!(psiFile instanceof XmlFile && AntDomFileDescription.isAntFile((XmlFile)psiFile))) {
    return null;
  }
  final Editor editor = dataContext.getData(LangDataKeys.EDITOR);
  if (editor == null) {
    return null;
  }
  return getPsiElementsIn(editor, psiFile);
}
项目:intellij-ce-playground    文件:AntAnnotatorsFilter.java   
@Override
public boolean isProhibited(ExternalAnnotator annotator, PsiFile file) {
  return annotator instanceof XMLExternalAnnotator &&
         file instanceof XmlFile &&
         AntDomFileDescription.isAntFile((XmlFile)file);
}
项目:intellij-ce-playground    文件:AntHectorPanelProvider.java   
public HectorComponentPanel createConfigurable(@NotNull final PsiFile file) {
  if (file instanceof XmlFile && AntDomFileDescription.isAntFile(((XmlFile)file))) {
    return new AntHectorConfigurable(((XmlFile)file));
  }
  return null;
}
项目:tools-idea    文件:AntAnnotatorsFilter.java   
@Override
public boolean isProhibited(ExternalAnnotator annotator, PsiFile file) {
  return annotator instanceof XMLExternalAnnotator &&
         file instanceof XmlFile &&
         AntDomFileDescription.isAntFile((XmlFile)file);
}
项目:tools-idea    文件:AntHectorPanelProvider.java   
public HectorComponentPanel createConfigurable(@NotNull final PsiFile file) {
  if (file instanceof XmlFile && AntDomFileDescription.isAntFile(((XmlFile)file))) {
    return new AntHectorConfigurable(((XmlFile)file));
  }
  return null;
}
项目:consulo-apache-ant    文件:AntAnnotatorsFilter.java   
@Override
public boolean isProhibited(ExternalAnnotator annotator, PsiFile file) {
  return annotator instanceof XMLExternalAnnotator &&
         file instanceof XmlFile &&
         AntDomFileDescription.isAntFile((XmlFile)file);
}
项目:consulo-apache-ant    文件:AntHectorPanelProvider.java   
public HectorComponentPanel createConfigurable(@NotNull final PsiFile file) {
  if (file instanceof XmlFile && AntDomFileDescription.isAntFile(((XmlFile)file))) {
    return new AntHectorConfigurable(((XmlFile)file));
  }
  return null;
}