本文整理汇总了Java中com.intellij.openapi.roots.LibraryOrderEntry.isModuleLevel方法的典型用法代码示例。如果您正苦于以下问题:Java LibraryOrderEntry.isModuleLevel方法的具体用法?Java LibraryOrderEntry.isModuleLevel怎么用?Java LibraryOrderEntry.isModuleLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.roots.LibraryOrderEntry
的用法示例。
在下文中一共展示了LibraryOrderEntry.isModuleLevel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findLibrary
import com.intellij.openapi.roots.LibraryOrderEntry; //导入方法依赖的package包/类
@Nullable
public Library findLibrary(@NotNull PackagingElementResolvingContext context) {
if (myModuleName == null) {
return context.findLibrary(myLevel, myLibraryName);
}
final ModulesProvider modulesProvider = context.getModulesProvider();
final Module module = modulesProvider.getModule(myModuleName);
if (module != null) {
for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) {
if (entry instanceof LibraryOrderEntry) {
final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
if (libraryEntry.isModuleLevel()) {
final String libraryName = libraryEntry.getLibraryName();
if (libraryName != null && libraryName.equals(myLibraryName)) {
return libraryEntry.getLibrary();
}
}
}
}
}
return null;
}
示例2: removeLibrary
import com.intellij.openapi.roots.LibraryOrderEntry; //导入方法依赖的package包/类
@Override
public void removeLibrary(@NotNull Library library) {
final Iterator<OrderEntry> orderIterator = myRootModel.getOrderIterator();
while (orderIterator.hasNext()) {
OrderEntry orderEntry = orderIterator.next();
if (orderEntry instanceof LibraryOrderEntry) {
final LibraryOrderEntry libraryOrderEntry = (LibraryOrderEntry) orderEntry;
if (libraryOrderEntry.isModuleLevel()) {
if (library.equals(libraryOrderEntry.getLibrary())) {
myRootModel.removeOrderEntry(orderEntry);
//Disposer.dispose(library);
return;
}
}
}
}
}
示例3: removeLibrary
import com.intellij.openapi.roots.LibraryOrderEntry; //导入方法依赖的package包/类
@Override
public void removeLibrary(@Nonnull Library library) {
final Iterator<OrderEntry> orderIterator = myRootLayer.getOrderIterator();
while (orderIterator.hasNext()) {
OrderEntry orderEntry = orderIterator.next();
if (orderEntry instanceof LibraryOrderEntry) {
final LibraryOrderEntry libraryOrderEntry = (LibraryOrderEntry) orderEntry;
if (libraryOrderEntry.isModuleLevel()) {
if (library.equals(libraryOrderEntry.getLibrary())) {
myRootLayer.removeOrderEntry(orderEntry);
//Disposer.dispose(library);
return;
}
}
}
}
}
示例4: findLibrary
import com.intellij.openapi.roots.LibraryOrderEntry; //导入方法依赖的package包/类
@Nullable
public Library findLibrary(@Nonnull PackagingElementResolvingContext context) {
if (myModuleName == null) {
return context.findLibrary(myLevel, myLibraryName);
}
final ModulesProvider modulesProvider = context.getModulesProvider();
final Module module = modulesProvider.getModule(myModuleName);
if (module != null) {
for (OrderEntry entry : modulesProvider.getRootModel(module).getOrderEntries()) {
if (entry instanceof LibraryOrderEntry) {
final LibraryOrderEntry libraryEntry = (LibraryOrderEntry)entry;
if (libraryEntry.isModuleLevel()) {
final String libraryName = libraryEntry.getLibraryName();
if (libraryName != null && libraryName.equals(myLibraryName)) {
return libraryEntry.getLibrary();
}
}
}
}
}
return null;
}
示例5: isEnabled
import com.intellij.openapi.roots.LibraryOrderEntry; //导入方法依赖的package包/类
@Override
protected boolean isEnabled() {
final OrderEntry entry = myPanel.getSelectedEntry();
boolean enabled = false;
if (entry instanceof LibraryOrderEntry) {
final LibraryOrderEntry libraryOrderEntry = (LibraryOrderEntry)entry;
if (libraryOrderEntry.getLibrary() != null) {
boolean isFromModuleLibrary = libraryOrderEntry.isModuleLevel();
boolean isToModuleLibrary = isConvertingToModuleLibrary();
enabled = isFromModuleLibrary != isToModuleLibrary;
}
}
return enabled;
}
示例6: isOrphanProjectLibrary
import com.intellij.openapi.roots.LibraryOrderEntry; //导入方法依赖的package包/类
private static boolean isOrphanProjectLibrary(@NotNull final Library library,
@NotNull final IdeModifiableModelsProvider modelsProvider) {
RootPolicy<Boolean> visitor = new RootPolicy<Boolean>() {
@Override
public Boolean visitLibraryOrderEntry(LibraryOrderEntry ideDependency, Boolean value) {
return !ideDependency.isModuleLevel() && library == ideDependency.getLibrary();
}
};
for (Module module : modelsProvider.getModules()) {
for (OrderEntry entry : modelsProvider.getOrderEntries(module)) {
if (entry.accept(visitor, false)) return false;
}
}
return true;
}