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


Java ContainerUtil.concat方法代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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