當前位置: 首頁>>代碼示例>>Java>>正文


Java AntDomProject類代碼示例

本文整理匯總了Java中com.intellij.lang.ant.dom.AntDomProject的典型用法代碼示例。如果您正苦於以下問題:Java AntDomProject類的具體用法?Java AntDomProject怎麽用?Java AntDomProject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AntDomProject類屬於com.intellij.lang.ant.dom包,在下文中一共展示了AntDomProject類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAntDomProjectForceAntFile

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
public static AntDomProject getAntDomProjectForceAntFile(PsiFile psiFile)
{
	if(psiFile instanceof XmlFile)
	{
		final DomManager domManager = DomManager.getDomManager(psiFile.getProject());
		DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile) psiFile, AntDomProject.class);
		if(fileElement == null)
		{
			ForcedAntFileAttribute.forceAntFile(psiFile.getVirtualFile(), true);
			fileElement = domManager.getFileElement((XmlFile) psiFile, AntDomProject.class);
		}
		return fileElement != null ? fileElement.getRootElement() : null;
	}
	return null;
}
 
開發者ID:consulo,項目名稱:consulo-apache-ant,代碼行數:17,代碼來源:AntSupport.java

示例2: findTask

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
public BuildTask findTask(final String taskName) {
  final PsiFile psiFile = PsiManager.getInstance(myProject).findFile(myFile);
  final AntDomProject domProject = AntSupport.getAntDomProject(psiFile);
  if (domProject != null) {
    final AntDomTarget antTarget = domProject.findDeclaredTarget(myName);
    if (antTarget != null) {
      final Ref<AntDomElement> result = new Ref<AntDomElement>(null);
      antTarget.accept(new AntDomRecursiveVisitor() {
        public void visitAntDomElement(AntDomElement element) {
          if (result.get() != null) {
            return;
          }
          if (element.isTask() && taskName.equals(element.getXmlElementName())) {
            result.set(element);
            return;
          }
          super.visitAntDomElement(element);
        }
      });
      final AntDomElement task = result.get();
      if (task != null) {
        return new BuildTask(this, task);
      }
    }
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:AntBuildTargetImpl.java

示例3: getAntDomProject

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
public static AntDomProject getAntDomProject(PsiFile psiFile) {
  if (psiFile instanceof XmlFile) {
    final DomManager domManager = DomManager.getDomManager(psiFile.getProject());
    final DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class);
    return fileElement != null? fileElement.getRootElement() : null;
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:AntSupport.java

示例4: getAntDomProjectForceAntFile

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
public static AntDomProject getAntDomProjectForceAntFile(PsiFile psiFile) {
  if (psiFile instanceof XmlFile) {
    final DomManager domManager = DomManager.getDomManager(psiFile.getProject());
    DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class);
    if (fileElement == null) {
      ForcedAntFileAttribute.forceAntFile(psiFile.getVirtualFile(), true);
      fileElement = domManager.getFileElement((XmlFile)psiFile, AntDomProject.class);
    }
    return fileElement != null? fileElement.getRootElement() : null;
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:AntSupport.java

示例5: getAntDomProject

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
public static AntDomProject getAntDomProject(PsiFile psiFile)
{
	if(psiFile instanceof XmlFile)
	{
		final DomManager domManager = DomManager.getDomManager(psiFile.getProject());
		final DomFileElement<AntDomProject> fileElement = domManager.getFileElement((XmlFile) psiFile, AntDomProject.class);
		return fileElement != null ? fileElement.getRootElement() : null;
	}
	return null;
}
 
開發者ID:consulo,項目名稱:consulo-apache-ant,代碼行數:12,代碼來源:AntSupport.java

示例6: AntInspection

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
protected AntInspection() {
  super(AntDomProject.class);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:AntInspection.java

示例7: getHelpFile

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
private static VirtualFile getHelpFile(final PsiElement element) {
  final XmlTag xmlTag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
  if (xmlTag == null) {
    return null;
  }
  final AntDomElement antElement = AntSupport.getAntDomElement(xmlTag);
  if (antElement == null) {
    return null;
  }
  final AntDomProject antProject = antElement.getAntProject();
  if (antProject == null) {
    return null;
  }
  final AntInstallation installation = antProject.getAntInstallation();
  if (installation == null) {
    return null; // not configured properly and bundled installation missing
  }
  final String antHomeDir = AntInstallation.HOME_DIR.get(installation.getProperties());

  if (antHomeDir == null) {
    return null;
  }
  
  @NonNls String path = antHomeDir + "/docs/manual";
  String url;
  if (new File(path).exists()) {
    url = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, FileUtil.toSystemIndependentName(path));
  }
  else {
    path = antHomeDir + "/docs.zip";
    if (new File(path).exists()) {
      url = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, FileUtil.toSystemIndependentName(path) + JarFileSystem.JAR_SEPARATOR + "docs/manual");
    }
    else {
      return null;
    }
  }

  final VirtualFile documentationRoot = VirtualFileManager.getInstance().findFileByUrl(url);
  if (documentationRoot == null) {
    return null;
  }
  
  return getHelpFile(antElement, documentationRoot);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:47,代碼來源:AntDomDocumentationProvider.java

示例8: getHelpFile

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable
private static VirtualFile getHelpFile(final PsiElement element) {
  final XmlTag xmlTag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
  if (xmlTag == null) {
    return null;
  }
  final AntDomElement antElement = AntSupport.getAntDomElement(xmlTag);
  if (antElement == null) {
    return null;
  }
  final AntDomProject antProject = antElement.getAntProject();
  if (antProject == null) {
    return null;
  }
  final Sdk installation = antProject.getAntInstallation();
  if (installation == null) {
    return null; // not configured properly and bundled installation missing
  }
  final String antHomeDir = installation.getHomePath();

  if (antHomeDir == null) {
    return null;
  }
  
  @NonNls String path = antHomeDir + "/docs/manual";
  String url;
  if (new File(path).exists()) {
    url = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, FileUtil.toSystemIndependentName(path));
  }
  else {
    path = antHomeDir + "/docs.zip";
    if (new File(path).exists()) {
      url = VirtualFileManager.constructUrl(ZipArchiveFileType.PROTOCOL, FileUtil.toSystemIndependentName(path) + URLUtil.ARCHIVE_SEPARATOR + "docs/manual");
    }
    else {
      return null;
    }
  }

  final VirtualFile documentationRoot = VirtualFileManager.getInstance().findFileByUrl(url);
  if (documentationRoot == null) {
    return null;
  }
  
  return getHelpFile(antElement, documentationRoot);
}
 
開發者ID:consulo,項目名稱:consulo-apache-ant,代碼行數:47,代碼來源:AntDomDocumentationProvider.java

示例9: getAntProject

import com.intellij.lang.ant.dom.AntDomProject; //導入依賴的package包/類
@Nullable AntDomProject getAntProject(); 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:2,代碼來源:AntBuildModelBase.java


注:本文中的com.intellij.lang.ant.dom.AntDomProject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。