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


Java LibraryKind类代码示例

本文整理汇总了Java中com.intellij.openapi.roots.libraries.LibraryKind的典型用法代码示例。如果您正苦于以下问题:Java LibraryKind类的具体用法?Java LibraryKind怎么用?Java LibraryKind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LibraryKind类属于com.intellij.openapi.roots.libraries包,在下文中一共展示了LibraryKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectUsages

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
@Override
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) {
  final Set<LibraryKind> usedKinds = new HashSet<LibraryKind>();
  final Processor<Library> processor = new Processor<Library>() {
    @Override
    public boolean process(Library library) {
      usedKinds.addAll(LibraryPresentationManagerImpl.getLibraryKinds(library, null));
      return true;
    }
  };
  for (Module module : ModuleManager.getInstance(project).getModules()) {
    ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(processor);
  }

  final HashSet<UsageDescriptor> usageDescriptors = new HashSet<UsageDescriptor>();
  for (LibraryKind kind : usedKinds) {
    usageDescriptors.add(new UsageDescriptor(kind.getKindId(), 1));
  }
  return usageDescriptors;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:LibraryUsageCollector.java

示例2: check

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
@Override
public ValidationResult check() {
  final Set<? extends LibraryKind> libraryKinds = myLibraryDescription.getSuitableLibraryKinds();
  final Ref<Boolean> found = Ref.create(false);
  myContext.getRootModel().orderEntries().using(myContext.getModulesProvider()).recursively().librariesOnly().forEachLibrary(new Processor<Library>() {
    @Override
    public boolean process(Library library) {
      if (LibraryPresentationManager.getInstance().isLibraryOfKind(library, myContext.getLibrariesContainer(), libraryKinds)) {
        found.set(true);
        return false;
      }
      return true;
    }
  });
  if (found.get()) return ValidationResult.OK;

  return new ValidationResult(IdeBundle.message("label.missed.libraries.text", myLibraryCategoryName), new LibrariesQuickFix(myLibraryDescription));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FrameworkLibraryValidatorImpl.java

示例3: check

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@Override
public ValidationResult check() {
  final Set<? extends LibraryKind> libraryKinds = myLibraryDescription.getSuitableLibraryKinds();
  final Ref<Boolean> found = Ref.create(false);
  myContext.getRootModel().orderEntries().using(myContext.getModulesProvider()).recursively().librariesOnly().forEachLibrary(new Processor<Library>() {
    @Override
    public boolean process(Library library) {
      if (LibraryPresentationManager.getInstance().isLibraryOfKind(library, myContext.getLibrariesContainer(), libraryKinds)) {
        found.set(true);
        return false;
      }
      return true;
    }
  });
  if (found.get()) return ValidationResult.OK;

  return new ValidationResult(StringUtil.capitalize(myLibraryCategoryName) + " library not found in the module dependencies list", new LibrariesQuickFix(myLibraryDescription));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:FrameworkLibraryValidatorImpl.java

示例4: getProjectUsages

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@Nonnull
@Override
public Set<UsageDescriptor> getProjectUsages(@Nonnull Project project) {
  final Set<LibraryKind> usedKinds = new HashSet<LibraryKind>();
  final Processor<Library> processor = new Processor<Library>() {
    @Override
    public boolean process(Library library) {
      usedKinds.addAll(LibraryPresentationManagerImpl.getLibraryKinds(library, null));
      return true;
    }
  };
  for (Module module : ModuleManager.getInstance(project).getModules()) {
    ModuleRootManager.getInstance(module).orderEntries().librariesOnly().forEachLibrary(processor);
  }

  final HashSet<UsageDescriptor> usageDescriptors = new HashSet<UsageDescriptor>();
  for (LibraryKind kind : usedKinds) {
    usageDescriptors.add(new UsageDescriptor(kind.getKindId(), 1));
  }
  return usageDescriptors;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:LibraryUsageCollector.java

示例5: updatePropertiesLabel

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
public void updatePropertiesLabel() {
  StringBuilder text = new StringBuilder();
  final LibraryType<?> type = getLibraryEditor().getType();
  final Set<LibraryKind> excluded =
    type != null ? Collections.<LibraryKind>singleton(type.getKind()) : Collections.<LibraryKind>emptySet();
  for (String description : LibraryPresentationManager.getInstance().getDescriptions(getLibraryEditor().getFiles(OrderRootType.CLASSES),
                                                                                     excluded)) {
    if (text.length() > 0) {
      text.append("\n");
    }
    text.append(description);
  }
  myPropertiesLabel.setText(text.toString());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:LibraryRootsComponent.java

示例6: forLibraryType

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@Nullable
public static LibrarySettingsProvider forLibraryType(LibraryKind libType) {
  for (LibrarySettingsProvider provider : Extensions.getExtensions(EP_NAME)) {
    if (provider.getLibraryKind().equals(libType)) {
      return provider;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:LibrarySettingsProvider.java

示例7: getAllGroovyKinds

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
public static Set<? extends LibraryKind> getAllGroovyKinds() {
  final HashSet<LibraryKind> kinds = new HashSet<LibraryKind>();
  for (LibraryPresentationProvider provider : LibraryPresentationProvider.EP_NAME.getExtensions()) {
    if (provider instanceof GroovyLibraryPresentationProviderBase) {
      kinds.add(provider.getKind());
    }
  }
  return kinds;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroovyLibraryDescription.java

示例8: updatePropertiesLabel

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
public void updatePropertiesLabel() {
  StringBuilder text = new StringBuilder();
  final LibraryType<?> type = getLibraryEditor().getType();
  final Set<LibraryKind> excluded =
    type != null ? Collections.<LibraryKind>singleton(type.getKind()) : Collections.<LibraryKind>emptySet();
  for (String description : LibraryPresentationManager.getInstance().getDescriptions(getLibraryEditor().getFiles(BinariesOrderRootType.getInstance()),
                                                                                     excluded)) {
    if (text.length() > 0) {
      text.append("\n");
    }
    text.append(description);
  }
  myPropertiesLabel.setText(text.toString());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:LibraryRootsComponent.java

示例9: MuleLibraryDescription

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
private MuleLibraryDescription(@NotNull final Set<? extends LibraryKind> libraryKinds)
{
    myLibraryKinds = libraryKinds;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:5,代码来源:MuleLibraryDescription.java

示例10: getSuitableLibraryKinds

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
@Override
public Set<? extends LibraryKind> getSuitableLibraryKinds()
{
    return myLibraryKinds;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:7,代码来源:MuleLibraryDescription.java

示例11: getDescriptions

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
public abstract List<String> getDescriptions(@NotNull VirtualFile[] classRoots, Set<LibraryKind> excludedKinds);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:LibraryPresentationManager.java

示例12: isLibraryOfKind

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
public abstract boolean isLibraryOfKind(@NotNull Library library, @NotNull LibrariesContainer librariesContainer,
@NotNull Set<? extends LibraryKind> acceptedKinds);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:LibraryPresentationManager.java

示例13: getSuitableLibraryKinds

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
public abstract Set<? extends LibraryKind> getSuitableLibraryKinds();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:CustomLibraryDescription.java

示例14: createLibrary

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
public abstract Library createLibrary(@NotNull Set<? extends LibraryKind> suitableLibraryKinds);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:FrameworkLibraryProvider.java

示例15: getSuitableLibraryKinds

import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
@Override
public Set<? extends LibraryKind> getSuitableLibraryKinds() {
  return Collections.singleton(myLibraryType.getKind());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CustomLibraryDescriptionImpl.java


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