当前位置: 首页>>代码示例>>Java>>正文


Java JavadocOrderRootType类代码示例

本文整理汇总了Java中com.intellij.openapi.roots.JavadocOrderRootType的典型用法代码示例。如果您正苦于以下问题:Java JavadocOrderRootType类的具体用法?Java JavadocOrderRootType怎么用?Java JavadocOrderRootType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JavadocOrderRootType类属于com.intellij.openapi.roots包,在下文中一共展示了JavadocOrderRootType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  super.setUp();
  final VirtualFile libClasses = getJarFile("library.jar");
  final VirtualFile libJavadocJar = getJarFile("library-javadoc.jar");

  ApplicationManager.getApplication().runWriteAction(() -> {
    final Library library = LibraryTablesRegistrar.getInstance().getLibraryTable(myProject).createLibrary("myLib");
    final Library.ModifiableModel model = library.getModifiableModel();
    model.addRoot(libClasses, OrderRootType.CLASSES);
    model.addRoot(libJavadocJar, JavadocOrderRootType.getInstance());
    model.commit();

    Module[] modules = ModuleManager.getInstance(myProject).getModules();
    assertSize(1, modules);
    ModuleRootModificationUtil.addDependency(modules[0], library);
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JavaExternalDocumentationTest.java

示例2: addJavaDocAndSources

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private static boolean addJavaDocAndSources(@NotNull List<OrderRoot> orderRoots, @NotNull VirtualFile dir) {
  boolean found = false;

  VirtualFile javadocDir = findJavadocDir(dir);
  if (javadocDir != null) {
    orderRoots.add(new OrderRoot(javadocDir, JavadocOrderRootType.getInstance()));
    found = true;
  }

  VirtualFile sourcesDir = dir.findChild(FD_SOURCES);
  if (sourcesDir != null) {
    orderRoots.add(new OrderRoot(sourcesDir, SOURCES));
    found = true;
  }
  return found;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidSdkUtils.java

示例3: save

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private void save() {
  if (myLibraryEditorComponent != null) {
    executeProjectChanges(myProject, new Runnable() {
      @Override
      public void run() {
        LibraryEditor editor = myLibraryEditorComponent.getLibraryEditor();
        Library.ModifiableModel libraryModel = myLibrary.getModifiableModel();
        try {
          addUrls(editor, libraryModel, SOURCES);
          addUrls(editor, libraryModel, JavadocOrderRootType.getInstance());
        }
        finally {
          libraryModel.commit();
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LibraryPropertiesDialog.java

示例4: appendJavadocRoots

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
static void appendJavadocRoots(Element element,
                               ModuleRootModel model,
                               final List<String> currentRoots,
                               Library.ModifiableModel modifiableModel) {
  final Element attributes = element.getChild("attributes");
  if (attributes == null) {
    return;
  }
  for (Object o : attributes.getChildren("attribute")) {
    if (Comparing.strEqual(((Element)o).getAttributeValue("name"), JAVADOC_LOCATION)) {
      Element attribute = (Element)o;
      String javadocPath = attribute.getAttributeValue("value");
      if (!SystemInfo.isWindows) {
        javadocPath = javadocPath.replaceFirst(FILE_PROTOCOL, FILE_PROTOCOL + "/");
      }
      modifiableModel.addRoot(toIdeaJavadocUrl(model, javadocPath, currentRoots), JavadocOrderRootType.getInstance());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:EJavadocUtil.java

示例5: addDocs

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@SuppressWarnings({"HardCodedStringLiteral"})
private static void addDocs(File file, SdkModificator rootContainer) {
  VirtualFile vFile = findDocs(file, "docs/api");
  if (vFile != null) {
    rootContainer.addRoot(vFile, JavadocOrderRootType.getInstance());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JavaSdkImpl.java

示例6: isRootTypeApplicable

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@Override
public boolean isRootTypeApplicable(OrderRootType type) {
  return type == OrderRootType.CLASSES ||
         type == OrderRootType.SOURCES ||
         type == JavadocOrderRootType.getInstance() ||
         type == AnnotationOrderRootType.getInstance();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:JavaSdkImpl.java

示例7: check

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@Override
public void check(ProjectStructureProblemsHolder problemsHolder) {
  if (((LibraryEx)myLibrary).isDisposed()) return;
  final LibraryEx library = (LibraryEx)myContext.getLibraryModel(myLibrary);
  if (library == null || library.isDisposed()) return;

  reportInvalidRoots(problemsHolder, library, OrderRootType.CLASSES, "classes", ProjectStructureProblemType.error("library-invalid-classes-path"));
  final String libraryName = library.getName();
  if (libraryName == null || !libraryName.startsWith("Maven: ")) {
    reportInvalidRoots(problemsHolder, library, OrderRootType.SOURCES, "sources",
                       ProjectStructureProblemType.warning("library-invalid-source-javadoc-path"));
    reportInvalidRoots(problemsHolder, library, JavadocOrderRootType.getInstance(), "javadoc",
                       ProjectStructureProblemType.warning("library-invalid-source-javadoc-path"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LibraryProjectStructureElement.java

示例8: setupJavadocAttributes

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
static void setupJavadocAttributes(Element orderEntry, LibraryOrderEntry libraryOrderEntry, final ModuleRootModel model) {
  setupAttributes(orderEntry, new Function<String, String>() {
    @Override
    public String fun(String s) {
      return toEclipseJavadocPath(model, s);
    }
  }, JAVADOC_LOCATION, libraryOrderEntry.getRootUrls(JavadocOrderRootType.getInstance()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:EJavadocUtil.java

示例9: addDocs

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private static void addDocs(SdkModificator sdkModificator, final Sdk javaSdk) {
  if (!addOrderEntries(JavadocOrderRootType.getInstance(), javaSdk, sdkModificator) &&
      SystemInfo.isMac){
    Sdk[] jdks = ProjectJdkTable.getInstance().getAllJdks();
    for (Sdk jdk : jdks) {
      if (jdk.getSdkType() instanceof JavaSdk) {
        addOrderEntries(JavadocOrderRootType.getInstance(), jdk, sdkModificator);
        break;
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:IdeaJdk.java

示例10: isRootTypeApplicable

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@Override
public boolean isRootTypeApplicable(@Nullable final OrderRootType type) {
  return
      type == OrderRootType.CLASSES ||
      type == OrderRootType.SOURCES ||
      type == JavadocOrderRootType.getInstance() ||
      type == AnnotationOrderRootType.getInstance();
}
 
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:9,代码来源:DefracSdkType.java

示例11: setupJavadocAttributes

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
static void setupJavadocAttributes(Element orderEntry, LibraryOrderEntry libraryOrderEntry, final ModuleRootModel model) {
  final List<String> eclipseUrls = new ArrayList<String>();
  final String[] docUrls = libraryOrderEntry.getRootUrls(JavadocOrderRootType.getInstance());
  if (docUrls.length > 0) {
    eclipseUrls.add(toEclipseJavadocPath(model, docUrls[0]));
  }

  final List children = new ArrayList(orderEntry.getChildren(ATTRIBUTES_TAG));
  for (Object o : children) {
    final Element attsElement = (Element)o;
    final ArrayList attTags = new ArrayList(attsElement.getChildren(ATTRIBUTE_TAG));
    for (Object a : attTags) {
      Element attElement = (Element)a;
      if (Comparing.strEqual(attElement.getAttributeValue("name"), JAVADOC_LOCATION)) {
        final String javadocPath = attElement.getAttributeValue("value");
        if (!eclipseUrls.remove(javadocPath)) {
          attElement.detach();
        }
      }
    }
  }

  for (final String docUrl : eclipseUrls) {
    Element child = orderEntry.getChild(ATTRIBUTES_TAG);
    if (child == null) {
      child = new Element(ATTRIBUTES_TAG);
      orderEntry.addContent(child);
    }

    final Element attrElement = new Element(ATTRIBUTE_TAG);
    child.addContent(attrElement);
    attrElement.setAttribute("name", JAVADOC_LOCATION);
    attrElement.setAttribute("value", docUrl);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:EJavadocUtil.java

示例12: setupSdkPaths

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
public static void setupSdkPaths(@Nullable VirtualFile sdkRoot, SdkModificator modificator) {
  if (sdkRoot == null) {
    return;
  }
  VirtualFile stdRoot;
  final String stdPath = System.getenv("HAXE_STD_PATH");
  if (stdPath != null) {
    stdRoot = VirtualFileManager.getInstance().findFileByUrl(stdPath);
  }
  else {
    stdRoot = sdkRoot.findChild("std");
  }
  if (stdRoot != null) {
    modificator.addRoot(stdRoot, OrderRootType.SOURCES);
    modificator.addRoot(stdRoot, OrderRootType.CLASSES);
  }
  VirtualFile docRoot;
  final String docPath = System.getenv("HAXE_DOC_PATH");
  if (docPath != null) {
    docRoot = VirtualFileManager.getInstance().findFileByUrl(docPath);
  }
  else {
    docRoot = sdkRoot.findChild("doc");
  }
  if (docRoot != null) {
    modificator.addRoot(docRoot, JavadocOrderRootType.getInstance());
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:29,代码来源:HaxeSdkUtil.java

示例13: sdkHasJavadocUrls

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
public static boolean sdkHasJavadocUrls(Project project) {
  Sdk sdk = JavadocGeneratorRunProfile.getSdk(project);
  return sdk != null && sdk.getRootProvider().getFiles(JavadocOrderRootType.getInstance()).length > 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JavadocConfigurable.java

示例14: JavadocRootDetector

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private JavadocRootDetector() {
  super(JavadocOrderRootType.getInstance(), false, "JavaDocs");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DefaultLibraryRootsComponentDescriptor.java

示例15: AttachUrlJavadocDescriptor

import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private AttachUrlJavadocDescriptor() {
  super(JavadocOrderRootType.getInstance(), IconUtil.getAddLinkIcon(), ProjectBundle.message("module.libraries.javadoc.url.button"));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DefaultLibraryRootsComponentDescriptor.java


注:本文中的com.intellij.openapi.roots.JavadocOrderRootType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。