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


Java LibraryOrderEntry.isModuleLevel方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LibraryPackagingElement.java

示例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;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ModuleLibraryTable.java

示例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;
        }
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ModuleLibraryTable.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:LibraryPackagingElement.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ChangeLibraryLevelInClasspathAction.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LibraryDataService.java


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