本文整理汇总了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;
}
示例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));
}
示例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));
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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());
}
示例9: MuleLibraryDescription
import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
private MuleLibraryDescription(@NotNull final Set<? extends LibraryKind> libraryKinds)
{
myLibraryKinds = libraryKinds;
}
示例10: getSuitableLibraryKinds
import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
@Override
public Set<? extends LibraryKind> getSuitableLibraryKinds()
{
return myLibraryKinds;
}
示例11: getDescriptions
import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
public abstract List<String> getDescriptions(@NotNull VirtualFile[] classRoots, Set<LibraryKind> excludedKinds);
示例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);
示例13: getSuitableLibraryKinds
import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
public abstract Set<? extends LibraryKind> getSuitableLibraryKinds();
示例14: createLibrary
import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
public abstract Library createLibrary(@NotNull Set<? extends LibraryKind> suitableLibraryKinds);
示例15: getSuitableLibraryKinds
import com.intellij.openapi.roots.libraries.LibraryKind; //导入依赖的package包/类
@NotNull
@Override
public Set<? extends LibraryKind> getSuitableLibraryKinds() {
return Collections.singleton(myLibraryType.getKind());
}