本文整理汇总了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);
});
}
示例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;
}
示例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();
}
}
});
}
}
示例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());
}
}
}
示例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());
}
}
示例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();
}
示例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"));
}
}
示例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()));
}
示例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;
}
}
}
}
示例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();
}
示例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);
}
}
示例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());
}
}
示例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;
}
示例14: JavadocRootDetector
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private JavadocRootDetector() {
super(JavadocOrderRootType.getInstance(), false, "JavaDocs");
}
示例15: AttachUrlJavadocDescriptor
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private AttachUrlJavadocDescriptor() {
super(JavadocOrderRootType.getInstance(), IconUtil.getAddLinkIcon(), ProjectBundle.message("module.libraries.javadoc.url.button"));
}