本文整理汇总了Java中com.intellij.openapi.roots.JavadocOrderRootType类的典型用法代码示例。如果您正苦于以下问题:Java JavadocOrderRootType类的具体用法?Java JavadocOrderRootType怎么用?Java JavadocOrderRootType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JavadocOrderRootType类属于com.intellij.openapi.roots包,在下文中一共展示了JavadocOrderRootType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: JavadocPathsEditor
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
public JavadocPathsEditor(Sdk sdk, FileChooserDescriptor descriptor) {
super(ProjectBundle.message("sdk.configure.javadoc.tab"), JavadocOrderRootType.getInstance(), descriptor);
mySdk = sdk;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JavadocOrderRootTypeUIFactory.java
示例17: getLibraryRootsForTarget
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@NotNull
public static List<OrderRoot> getLibraryRootsForTarget(@NotNull IAndroidTarget target,
@Nullable String sdkPath,
boolean addPlatformAndAddOnJars) {
List<OrderRoot> result = Lists.newArrayList();
if (addPlatformAndAddOnJars) {
for (VirtualFile file : getPlatformAndAddOnJars(target)) {
result.add(new OrderRoot(file, CLASSES));
}
}
VirtualFile platformDir = getPlatformDir(target);
if (platformDir == null) return result;
VirtualFile targetDir = platformDir;
if (!target.isPlatform()) {
targetDir = findFileInLocalFileSystem(target.getLocation());
}
boolean docsOrSourcesFound = false;
if (targetDir != null) {
docsOrSourcesFound = addJavaDocAndSources(result, targetDir);
}
VirtualFile sdkDir = sdkPath != null ? findFileInLocalFileSystem(sdkPath) : null;
VirtualFile sourcesDir = null;
if (sdkDir != null) {
docsOrSourcesFound = addJavaDocAndSources(result, sdkDir) || docsOrSourcesFound;
sourcesDir = sdkDir.findChild(FD_PKG_SOURCES);
}
// todo: replace it by target.getPath(SOURCES) when it'll be up to date
if (sourcesDir != null && sourcesDir.isDirectory()) {
VirtualFile platformSourcesDir = sourcesDir.findChild(platformDir.getName());
if (platformSourcesDir != null && platformSourcesDir.isDirectory()) {
result.add(new OrderRoot(platformSourcesDir, SOURCES));
docsOrSourcesFound = true;
}
}
if (!docsOrSourcesFound) {
VirtualFile javadoc = VirtualFileManager.getInstance().findFileByUrl(DEFAULT_EXTERNAL_DOCUMENTATION_URL);
if (javadoc != null) {
result.add(new OrderRoot(javadoc, JavadocOrderRootType.getInstance()));
}
}
String resFolderPath = target.getPath(RESOURCES);
if (resFolderPath != null) {
VirtualFile resFolder = findFileInLocalFileSystem(resFolderPath);
if (resFolder != null) {
result.add(new OrderRoot(resFolder, CLASSES));
}
}
// Explicitly add annotations.jar unless the target platform already provides it (API16+).
if (sdkPath != null && needsAnnotationsJarInClasspath(target)) {
String annotationsJarPath = toSystemIndependentName(sdkPath) + ANNOTATIONS_JAR_RELATIVE_PATH;
VirtualFile annotationsJar = findFileInJarFileSystem(annotationsJarPath);
if (annotationsJar != null) {
result.add(new OrderRoot(annotationsJar, CLASSES));
}
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:66,代码来源:AndroidSdkUtils.java
示例18: createAndroidSdk
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
public static Sdk createAndroidSdk(String sdkPath, String platformDir) {
Sdk sdk = ProjectJdkTable.getInstance().createSdk("android_test_sdk", AndroidSdkType.getInstance());
SdkModificator sdkModificator = sdk.getSdkModificator();
sdkModificator.setHomePath(sdkPath);
VirtualFile androidJar;
if (platformDir.equals(getDefaultPlatformDir())) {
// Compatibility: the unit tests were using android.jar outside the sdk1.5 install;
// we need to use that one, rather than the real one in sdk1.5, in order for the
// tests to pass. Longer term, we should switch the unit tests over to all using
// a valid SDK.
String androidJarPath = sdkPath + "/../android.jar!/";
androidJar = JarFileSystem.getInstance().findFileByPath(androidJarPath);
} else {
androidJar = LocalFileSystem.getInstance().findFileByPath(sdkPath + "/platforms/" + platformDir + "/android.jar");
}
sdkModificator.addRoot(androidJar, OrderRootType.CLASSES);
VirtualFile resFolder = LocalFileSystem.getInstance().findFileByPath(sdkPath + "/platforms/" + platformDir + "/data/res");
sdkModificator.addRoot(resFolder, OrderRootType.CLASSES);
VirtualFile docsFolder = LocalFileSystem.getInstance().findFileByPath(sdkPath + "/docs/reference");
if (docsFolder != null) {
sdkModificator.addRoot(docsFolder, JavadocOrderRootType.getInstance());
}
AndroidSdkAdditionalData data = new AndroidSdkAdditionalData(sdk);
AndroidSdkData sdkData = AndroidSdkData.getSdkData(sdkPath);
assertNotNull(sdkData);
IAndroidTarget target = sdkData.findTargetByName("Android 4.2"); // TODO: Get rid of this hardcoded version number
if (target == null) {
IAndroidTarget[] targets = sdkData.getTargets();
for (IAndroidTarget t : targets) {
if (t.getLocation().contains(platformDir)) {
target = t;
break;
}
}
if (target == null && targets.length > 0) {
target = targets[targets.length - 1];
}
}
assertNotNull(target);
data.setBuildTarget(target);
sdkModificator.setSdkAdditionalData(data);
sdkModificator.commitChanges();
return sdk;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:AndroidTestBase.java
示例19: requireJavadocUrls
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
@NotNull
public LibraryFixture requireJavadocUrls(@NotNull String... urls) {
String[] actualUrls = myLibrary.getUrls(JavadocOrderRootType.getInstance());
assertThat(actualUrls).as("Javadoc URLs").containsOnly(urls);
return this;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:LibraryFixture.java
示例20: doTestExisting
import com.intellij.openapi.roots.JavadocOrderRootType; //导入依赖的package包/类
private void doTestExisting(final String[] classRoots, final String[] sourceRoots, final String[] javadocs) throws Exception {
final Project project = getProject();
final String path = project.getBaseDir().getPath() + "/test";
final Module module = EclipseClasspathTest.setUpModule(path, project);
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
final ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel();
final String parentUrl = VirtualFileManager.constructUrl(JarFileSystem.PROTOCOL, model.getContentRoots()[0].getParent().getPath());
final Library library = model.getModuleLibraryTable().getLibraryByName("test.jar");
final Library.ModifiableModel libModifiableModel = library.getModifiableModel();
final String[] oldClsRoots = libModifiableModel.getUrls(OrderRootType.CLASSES);
for (String oldClsRoot : oldClsRoots) {
libModifiableModel.removeRoot(oldClsRoot, OrderRootType.CLASSES);
}
final String[] oldSrcRoots = libModifiableModel.getUrls(OrderRootType.SOURCES);
for (String oldSrcRoot : oldSrcRoots) {
libModifiableModel.removeRoot(oldSrcRoot, OrderRootType.SOURCES);
}
final String[] oldJdcRoots = libModifiableModel.getUrls(JavadocOrderRootType.getInstance());
for (String oldJavadocRoot : oldJdcRoots) {
libModifiableModel.removeRoot(oldJavadocRoot, JavadocOrderRootType.getInstance());
}
for (String classRoot : classRoots) {
libModifiableModel.addRoot(parentUrl + classRoot, OrderRootType.CLASSES);
}
for (String sourceRoot : sourceRoots) {
libModifiableModel.addRoot(parentUrl + sourceRoot, OrderRootType.SOURCES);
}
for (String javadocRoot : javadocs) {
libModifiableModel.addRoot(parentUrl + javadocRoot, JavadocOrderRootType.getInstance());
}
libModifiableModel.commit();
model.commit();
}
});
EclipseClasspathTest.checkModule(project.getBaseDir().getPath() + "/expected", module);
EclipseEmlTest.checkModule(project.getBaseDir().getPath() + "/expected", module);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:EclipseLibrariesModificationsTest.java
注:本文中的com.intellij.openapi.roots.JavadocOrderRootType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论