本文整理汇总了Java中com.intellij.openapi.roots.libraries.PersistentLibraryKind类的典型用法代码示例。如果您正苦于以下问题:Java PersistentLibraryKind类的具体用法?Java PersistentLibraryKind怎么用?Java PersistentLibraryKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PersistentLibraryKind类属于com.intellij.openapi.roots.libraries包,在下文中一共展示了PersistentLibraryKind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getLibraryRoots
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@NotNull
public static VirtualFile[] getLibraryRoots(@NotNull LibraryOrderEntry orderEntry) {
Library library = orderEntry.getLibrary();
if (library == null) return VirtualFile.EMPTY_ARRAY;
OrderRootType[] rootTypes = LibraryType.DEFAULT_EXTERNAL_ROOT_TYPES;
if (library instanceof LibraryEx) {
if (((LibraryEx)library).isDisposed()) return VirtualFile.EMPTY_ARRAY;
PersistentLibraryKind<?> libKind = ((LibraryEx)library).getKind();
if (libKind != null) {
rootTypes = LibraryType.findByKind(libKind).getExternalRootTypes();
}
}
final ArrayList<VirtualFile> files = new ArrayList<VirtualFile>();
for (OrderRootType rootType : rootTypes) {
files.addAll(Arrays.asList(library.getFiles(rootType)));
}
return VfsUtilCore.toVirtualFileArray(files);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LibraryGroupNode.java
示例2: addLibrariesFromModule
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
private static void addLibrariesFromModule(Module module, Collection<String> list) {
final OrderEntry[] entries = ModuleRootManager.getInstance(module).getOrderEntries();
for (OrderEntry entry : entries) {
if (entry instanceof LibraryOrderEntry) {
final String name = ((LibraryOrderEntry)entry).getLibraryName();
if (name != null && name.endsWith(LibraryContributingFacet.PYTHON_FACET_LIBRARY_NAME_SUFFIX)) {
// skip libraries from Python facet
continue;
}
for (VirtualFile root : ((LibraryOrderEntry)entry).getRootFiles(OrderRootType.CLASSES)) {
final Library library = ((LibraryOrderEntry)entry).getLibrary();
if (!PlatformUtils.isPyCharm()) {
addToPythonPath(root, list);
}
else if (library instanceof LibraryImpl) {
final PersistentLibraryKind<?> kind = ((LibraryImpl)library).getKind();
if (kind == PythonLibraryType.getInstance().getKind()) {
addToPythonPath(root, list);
}
}
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:PythonCommandLineState.java
示例3: createLibraryFromRoots
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
private Library createLibraryFromRoots(ModifiableModuleRootLayer layer, List<OrderRoot> roots, @Nullable final LibraryType libraryType) {
final LibraryTable.ModifiableModel moduleLibraryModel = layer.getModuleLibraryTable().getModifiableModel();
final PersistentLibraryKind kind = libraryType == null ? null : libraryType.getKind();
final Library library = ((LibraryTableBase.ModifiableModelEx)moduleLibraryModel).createLibrary(null, kind);
final LibraryEx.ModifiableModelEx libModel = (LibraryEx.ModifiableModelEx)library.getModifiableModel();
for (OrderRoot root : roots) {
if (root.isJarDirectory()) {
libModel.addJarDirectory(root.getFile(), false, root.getType());
}
else {
libModel.addRoot(root.getFile(), root.getType());
}
}
libModel.commit();
return library;
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:FileOrDirectoryDependencyTabContext.java
示例4: getLibraryRoots
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Nonnull
static VirtualFile[] getLibraryRoots(@Nonnull LibraryOrderEntry orderEntry) {
Library library = orderEntry.getLibrary();
if (library == null) return VirtualFile.EMPTY_ARRAY;
OrderRootType[] rootTypes = LibraryType.DEFAULT_EXTERNAL_ROOT_TYPES;
if (library instanceof LibraryEx) {
if (((LibraryEx)library).isDisposed()) return VirtualFile.EMPTY_ARRAY;
PersistentLibraryKind<?> libKind = ((LibraryEx)library).getKind();
if (libKind != null) {
rootTypes = LibraryType.findByKind(libKind).getExternalRootTypes();
}
}
final ArrayList<VirtualFile> files = new ArrayList<VirtualFile>();
for (OrderRootType rootType : rootTypes) {
files.addAll(Arrays.asList(library.getFiles(rootType)));
}
return VfsUtilCore.toVirtualFileArray(files);
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:LibraryGroupNode.java
示例5: createLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public Library createLibrary(String name, @Nullable PersistentLibraryKind type) {
final Library library = getLibrariesModifiableModel().createLibrary(name, type);
//createLibraryEditor(library); \
final BaseLibrariesConfigurable configurable = ProjectStructureConfigurable.getInstance(myProject).getConfigurableFor(library);
configurable.createLibraryNode(library);
return library;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LibrariesModifiableModel.java
示例6: createLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public Library createLibrary(String name, @Nullable PersistentLibraryKind kind) {
assertWritable();
final LibraryImpl library = new LibraryImpl(name, kind, LibraryTableBase.this, null);
myLibraries.add(library);
myLibraryByNameCache = null;
return library;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LibraryTableBase.java
示例7: getLibrarySettingsConfigurable
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Nullable
private static Configurable getLibrarySettingsConfigurable(OrderEntry orderEntry) {
if (!(orderEntry instanceof LibraryOrderEntry)) return null;
LibraryOrderEntry libOrderEntry = (LibraryOrderEntry)orderEntry;
Library lib = libOrderEntry.getLibrary();
if (lib instanceof LibraryEx) {
Project project = libOrderEntry.getOwnerModule().getProject();
PersistentLibraryKind<?> libKind = ((LibraryEx)lib).getKind();
if (libKind != null) {
return LibrarySettingsProvider.getAdditionalSettingsConfigurable(project, libKind);
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ProjectSettingsService.java
示例8: PythonLibraryType
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
public PythonLibraryType() {
super(
new PersistentLibraryKind<LibraryVersionProperties>("dummy.type") {
@NotNull
@Override
public LibraryVersionProperties createDefaultProperties() {
return new LibraryVersionProperties();
}
}
);
}
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:12,代码来源:PythonLibraryType.java
示例9: createLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public Library createLibrary(String name, @Nullable PersistentLibraryKind type) {
final Library library = ((LibraryTableBase.ModifiableModelEx)getLibrariesModifiableModel()).createLibrary(name, type);
//createLibraryEditor(library); \
final BaseLibrariesConfigurable configurable = ProjectStructureConfigurable.getInstance(myProject).getConfigurableFor(library);
configurable.createLibraryNode(library);
return library;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:LibrariesModifiableModel.java
示例10: DownloadableLibraryTypeBase
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
protected DownloadableLibraryTypeBase(@NotNull String libraryCategoryName,
@NotNull String libraryTypeId,
@NotNull String groupId,
@NotNull Icon icon,
@NotNull URL... localUrls) {
super(new PersistentLibraryKind<LibraryVersionProperties>(libraryTypeId) {
@NotNull
@Override
public LibraryVersionProperties createDefaultProperties() {
return new LibraryVersionProperties();
}
}, libraryCategoryName,
DownloadableLibraryService.getInstance().createLibraryDescription(groupId, localUrls));
myIcon = icon;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:DownloadableLibraryTypeBase.java
示例11: createLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public Library createLibrary(String name, @Nullable PersistentLibraryKind kind) {
assertWritable();
final LibraryImpl library = new LibraryImpl(name, kind, LibraryTableBase.this, null);
myLibraries.add(library);
return library;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:LibraryTableBase.java
示例12: SandLibraryType
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
protected SandLibraryType() {
super(new PersistentLibraryKind<DummyLibraryProperties>("sand") {
@Nonnull
@Override
public DummyLibraryProperties createDefaultProperties() {
return new DummyLibraryProperties();
}
});
}
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:SandLibraryType.java
示例13: getKind
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Nullable
PersistentLibraryKind<?> getKind();
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:LibraryEx.java
示例14: getKind
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public PersistentLibraryKind<?> getKind() {
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JpsLibraryDelegate.java
示例15: createLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public Library createLibrary(String name, @Nullable PersistentLibraryKind type) {
throw new UnsupportedOperationException("'createLibrary' not implemented in " + getClass().getName());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JpsLibraryTableImpl.java
示例16: createModuleLevelLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
public static Library createModuleLevelLibrary(@Nullable String name,
PersistentLibraryKind kind,
@NotNull RootModelImpl rootModel) {
return new LibraryImpl(name, kind, null, rootModel);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:LibraryTableImplUtil.java
示例17: createLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
@Override
public Library createLibrary(String name, @Nullable PersistentLibraryKind kind) {
LibraryOrderEntry orderEntry = new ModuleLibraryOrderEntryImpl(name, kind, myRootModel, myProjectRootManager);
myRootModel.addOrderEntry(orderEntry);
return orderEntry.getLibrary();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ModuleLibraryTable.java
示例18: ModuleLibraryOrderEntryImpl
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
ModuleLibraryOrderEntryImpl(String name, final PersistentLibraryKind kind, @NotNull RootModelImpl rootModel, @NotNull ProjectRootManagerImpl projectRootManager) {
super(rootModel, projectRootManager);
myLibrary = LibraryTableImplUtil.createModuleLevelLibrary(name, kind, getRootModel());
doinit();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ModuleLibraryOrderEntryImpl.java
示例19: DownloadableLibraryType
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
public DownloadableLibraryType(@NotNull PersistentLibraryKind<LibraryVersionProperties> kind, @NotNull String libraryCategoryName,
@NotNull DownloadableLibraryDescription description) {
super(kind);
myLibraryCategoryName = libraryCategoryName;
myLibraryDescription = description;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:DownloadableLibraryType.java
示例20: createModuleLevelLibrary
import com.intellij.openapi.roots.libraries.PersistentLibraryKind; //导入依赖的package包/类
public static Library createModuleLevelLibrary(@Nullable String name,
final PersistentLibraryKind kind,
RootModelImpl rootModel) {
return new LibraryImpl(name, kind, null, rootModel);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:LibraryTableImplUtil.java
注:本文中的com.intellij.openapi.roots.libraries.PersistentLibraryKind类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论