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


Java AntDomProject.getAntInstallation方法代碼示例

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


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

示例1: 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

示例2: 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


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