本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.concat方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.concat方法的具体用法?Java ContainerUtil.concat怎么用?Java ContainerUtil.concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.concat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findUsages
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void findUsages(@NotNull final PsiElement[] primaryElements,
@NotNull final PsiElement[] secondaryElements,
@NotNull final FindUsagesHandler handler,
@NotNull final FindUsagesOptions findUsagesOptions,
final boolean toSkipUsagePanelWhenOneUsage) {
if (primaryElements.length == 0) {
throw new AssertionError(handler + " " + findUsagesOptions);
}
Iterable<PsiElement> allElements = ContainerUtil.concat(primaryElements, secondaryElements);
final PsiElement2UsageTargetAdapter[] targets = convertToUsageTargets(allElements, findUsagesOptions);
myAnotherManager.searchAndShowUsages(targets, new Factory<UsageSearcher>() {
@Override
public UsageSearcher create() {
return createUsageSearcher(primaryElements, secondaryElements, handler, findUsagesOptions, null);
}
}, !toSkipUsagePanelWhenOneUsage, true, createPresentation(primaryElements[0], findUsagesOptions, shouldOpenInNewTab()), null);
myHistory.add(targets[0]);
}
示例2: checkDomFile
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
* not intended to be overridden or called by implementors
*/
@Nullable
protected ProblemDescriptor[] checkDomFile(@NotNull final DomFileElement<T> domFileElement,
@NotNull final InspectionManager manager,
@SuppressWarnings("UnusedParameters") final boolean isOnTheFly) {
final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(manager.getProject());
final List<DomElementProblemDescriptor> list = annotationsManager.checkFileElement(domFileElement, this, isOnTheFly);
if (list.isEmpty()) return ProblemDescriptor.EMPTY_ARRAY;
List<ProblemDescriptor> problems =
ContainerUtil.concat(list, new Function<DomElementProblemDescriptor, Collection<? extends ProblemDescriptor>>() {
@Override
public Collection<ProblemDescriptor> fun(final DomElementProblemDescriptor s) {
return annotationsManager.createProblemDescriptors(manager, s);
}
});
return problems.toArray(new ProblemDescriptor[problems.size()]);
}
示例3: merge
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static GitCommandResult merge(@Nullable GitCommandResult first, @NotNull GitCommandResult second) {
if (first == null) return second;
int mergedExitCode;
if (first.myExitCode == 0) {
mergedExitCode = second.myExitCode;
}
else if (second.myExitCode == 0) {
mergedExitCode = first.myExitCode;
}
else {
mergedExitCode = second.myExitCode; // take exit code of the latest command
}
return new GitCommandResult(first.success() && second.success(), mergedExitCode,
ContainerUtil.concat(first.myErrorOutput, second.myErrorOutput),
ContainerUtil.concat(first.myOutput, second.myOutput),
ObjectUtils.chooseNotNull(second.myException, first.myException));
}
示例4: computeKinds
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static List<Pair<LibraryKind, LibraryProperties>> computeKinds(List<VirtualFile> files) {
final SmartList<Pair<LibraryKind, LibraryProperties>> result = new SmartList<Pair<LibraryKind, LibraryProperties>>();
final LibraryType<?>[] libraryTypes = LibraryType.EP_NAME.getExtensions();
final LibraryPresentationProvider[] presentationProviders = LibraryPresentationProvider.EP_NAME.getExtensions();
for (LibraryPresentationProvider provider : ContainerUtil.concat(libraryTypes, presentationProviders)) {
final LibraryProperties properties = provider.detect(files);
if (properties != null) {
result.add(Pair.create(provider.getKind(), properties));
}
}
return result;
}
示例5: getAllDeclaredAttributeNames
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
* Returns all attributes: methods, class and instance fields that are declared directly in the specified class
* (not taking inheritance into account).
* <p/>
* This method <b>must not</b> access the AST because it is being called during stub indexing.
*/
@NotNull
public static List<String> getAllDeclaredAttributeNames(@NotNull PyClass pyClass) {
final List<PsiNamedElement> members = ContainerUtil.<PsiNamedElement>concat(pyClass.getInstanceAttributes(),
pyClass.getClassAttributes(),
Arrays.asList(pyClass.getMethods(false)));
return ContainerUtil.mapNotNull(members, new Function<PsiNamedElement, String>() {
@Override
public String fun(PsiNamedElement expression) {
final String attrName = expression.getName();
return attrName != null ? attrName : null;
}
});
}
示例6: getEncapsulatableClassMembers
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
protected synchronized static List<EncapsulatableClassMember> getEncapsulatableClassMembers(final PsiClass psiClass) {
return ContainerUtil.concat(ourProviders, new Function<NotNullFunction<PsiClass, Collection<EncapsulatableClassMember>>, Collection<? extends EncapsulatableClassMember>>() {
@Override
public Collection<? extends EncapsulatableClassMember> fun(NotNullFunction<PsiClass, Collection<EncapsulatableClassMember>> s) {
return s.fun(psiClass);
}
});
}
示例7: getNodeComparator
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
protected Comparator<MyNode> getNodeComparator() {
List<Comparator<MyNode>> comparators = ContainerUtil
.mapNotNull(ModuleStructureExtension.EP_NAME.getExtensions(), new Function<ModuleStructureExtension, Comparator<MyNode>>() {
@Override
public Comparator<MyNode> fun(final ModuleStructureExtension moduleStructureExtension) {
return moduleStructureExtension.getNodeComparator();
}
});
return new MergingComparator<MyNode>(ContainerUtil.concat(comparators, Collections.singletonList(NODE_COMPARATOR)));
}
示例8: getAllScheduledUpdates
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private List<Update> getAllScheduledUpdates() {
return ContainerUtil.concat(myScheduledUpdates.values(), new Function<Map<Update, Update>, Collection<? extends Update>>() {
@Override
public Collection<? extends Update> fun(Map<Update, Update> map) {
return map.keySet();
}
});
}
示例9: getInfos
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static List<GroovyMethodInfo> getInfos(PsiMethod method) {
ensureInit();
List<GroovyMethodInfo> lightMethodInfos = null;
Object methodKind = GrLightMethodBuilder.getMethodKind(method);
if (methodKind instanceof String) {
lightMethodInfos = getInfos(LIGHT_METHOD_INFOS, (String)methodKind, method);
}
List<GroovyMethodInfo> methodInfos = null;
PsiClass containingClass = method.getContainingClass();
if (containingClass != null) {
methodInfos = getInfos(METHOD_INFOS, containingClass.getQualifiedName(), method);
}
if (methodInfos == null) {
return lightMethodInfos == null ? Collections.<GroovyMethodInfo>emptyList() : lightMethodInfos;
}
else {
if (lightMethodInfos == null) {
return methodInfos;
}
else {
return ContainerUtil.concat(lightMethodInfos, methodInfos);
}
}
}
示例10: getStaticMethods
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static Set<Method> getStaticMethods(List<Class> patternClasses) {
return new THashSet<Method>(ContainerUtil.concat(patternClasses, new Function<Class, Collection<? extends Method>>() {
public Collection<Method> fun(final Class aClass) {
return ContainerUtil.findAll(aClass.getMethods(), new Condition<Method>() {
public boolean value(final Method method) {
return Modifier.isStatic(method.getModifiers())
&& Modifier.isPublic(method.getModifiers())
&& !Modifier.isAbstract(method.getModifiers())
&& ElementPattern.class.isAssignableFrom(method.getReturnType());
}
});
}
}));
}
示例11: findConfiguration
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Nullable
private FileColorConfiguration findConfiguration(@NotNull final VirtualFile colored) {
for (FileColorConfiguration configuration : ContainerUtil.concat(myApplicationLevelConfigurations, myProjectLevelConfigurations)) {
NamedScope scope = NamedScopesHolder.getScope(myProject, configuration.getScopeName());
if (scope != null) {
NamedScopesHolder namedScopesHolder = NamedScopesHolder.getHolder(myProject, configuration.getScopeName(), null);
PackageSet packageSet = scope.getValue();
if (packageSet instanceof PackageSetBase && namedScopesHolder != null && ((PackageSetBase)packageSet).contains(colored, myProject, namedScopesHolder)) {
return configuration;
}
}
}
return null;
}
示例12: getFilteredResourcesRoots
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static Set<VirtualFile> getFilteredResourcesRoots(@NotNull MavenProject mavenProject) {
Pair<Long, Set<VirtualFile>> cachedValue = mavenProject.getCachedValue(FILTERED_RESOURCES_ROOTS_KEY);
if (cachedValue == null || cachedValue.first != VirtualFileManager.getInstance().getModificationCount()) {
Set<VirtualFile> set = null;
for (MavenResource resource : ContainerUtil.concat(mavenProject.getResources(), mavenProject.getTestResources())) {
if (!resource.isFiltered()) continue;
VirtualFile resourceDir = LocalFileSystem.getInstance().findFileByPath(resource.getDirectory());
if (resourceDir == null) continue;
if (set == null) {
set = new HashSet<VirtualFile>();
}
set.add(resourceDir);
}
if (set == null) {
set = Collections.emptySet();
}
cachedValue = Pair.create(VirtualFileManager.getInstance().getModificationCount(), set);
mavenProject.putCachedValue(FILTERED_RESOURCES_ROOTS_KEY, cachedValue);
}
return cachedValue.second;
}
示例13: getAttachments
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<Attachment> getAttachments() {
return ContainerUtil.concat(getMessages(), new Function<AbstractMessage, Collection<? extends Attachment>>() {
@Override
public Collection<? extends Attachment> fun(AbstractMessage message) {
return message.getAttachments();
}
});
}
示例14: getLogicalRoots
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public List<LogicalRoot> getLogicalRoots() {
return ContainerUtil.concat(myModuleManager.getModules(), new Function<Module, Collection<? extends LogicalRoot>>() {
@Override
public Collection<? extends LogicalRoot> fun(final Module module) {
return getLogicalRoots(module);
}
});
}
示例15: getPlainListFromAllRoots
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<StubElement<?>> getPlainListFromAllRoots() {
final PsiFileStub[] roots = getRoot().getStubRoots();
if (roots.length == 1) return super.getPlainListFromAllRoots();
return ContainerUtil.concat(roots, new Function<PsiFileStub, Collection<? extends StubElement<?>>>() {
@Override
public Collection<? extends StubElement<?>> fun(PsiFileStub stub) {
final ObjectStubTree existingTree = stub.getUserData(STUB_TO_TREE_REFERENCE);
//noinspection unchecked
return existingTree != null ? existingTree.getPlainList() : new StubTree(stub, false).getPlainList();
}
});
}