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


Java ContainerUtil.collect方法代码示例

本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.collect方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.collect方法的具体用法?Java ContainerUtil.collect怎么用?Java ContainerUtil.collect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.containers.ContainerUtil的用法示例。


在下文中一共展示了ContainerUtil.collect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: analyzeModuleConflicts

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static void analyzeModuleConflicts(final Project project,
                                          final Collection<? extends PsiElement> scopes,
                                          final UsageInfo[] usages,
                                          final PsiElement target,
                                          final MultiMap<PsiElement,String> conflicts) {
  if (scopes == null) return;
  final VirtualFile vFile = PsiUtilCore.getVirtualFile(target);
  if (vFile == null) return;


  List<GroovyPsiElement> groovyScopes =
    ContainerUtil.collect(scopes.iterator(), new FilteringIterator.InstanceOf<GroovyPsiElement>(GroovyPsiElement.class));
  analyzeModuleConflicts(project, groovyScopes, usages, vFile, conflicts);
  scopes.removeAll(groovyScopes);
  RefactoringConflictsUtil.analyzeModuleConflicts(project, scopes, usages, vFile, conflicts);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GrRefactoringConflictsUtil.java

示例2: findPropertiesByKey

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<IProperty> findPropertiesByKey(@NotNull @NonNls String key) {
  synchronized (myLock) {
    ensurePropertiesLoaded();
    return ContainerUtil.collect(myPropertiesMap.get(key).iterator());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XmlPropertiesFileImpl.java

示例3: findPropertiesByKey

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
@NotNull
public List<IProperty> findPropertiesByKey(@NotNull String key) {
  ensurePropertiesLoaded();
  synchronized (lock) {
    return ContainerUtil.collect(myPropertiesMap.get(key).iterator());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PropertiesFileImpl.java

示例4: visitFile

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public void visitFile(final PsiFile file) {
  final VirtualFile virtualFile = file.getVirtualFile();
  if (virtualFile == null) {
    return;
  }

  final Project project = file.getProject();
  Document document = PsiDocumentManager.getInstance(project).getDocument(file);
  if (document == null) return;
  DaemonProgressIndicator progress = new DaemonProgressIndicator();
  progress.start();
  try {
    TextEditorHighlightingPassRegistrarEx passRegistrarEx = TextEditorHighlightingPassRegistrarEx.getInstanceEx(project);
    List<TextEditorHighlightingPass> passes = passRegistrarEx.instantiateMainPasses(file, document, HighlightInfoProcessor.getEmpty());
    List<GeneralHighlightingPass> gpasses = ContainerUtil.collect(passes.iterator(), FilteringIterator.instanceOf(GeneralHighlightingPass.class));
    for (final GeneralHighlightingPass gpass : gpasses) {
      gpass.setHighlightVisitorProducer(new NotNullProducer<HighlightVisitor[]>() {
        @NotNull
        @Override
        public HighlightVisitor[] produce() {
          gpass.incVisitorUsageCount(1);
          return new HighlightVisitor[]{new DefaultHighlightVisitor(project, highlightErrorElements, runAnnotators, true)};
        }
      });
    }


    for (TextEditorHighlightingPass pass : gpasses) {
      pass.doCollectInformation(progress);
      List<HighlightInfo> infos = pass.getInfos();
      for (HighlightInfo info : infos) {
        if (info == null) continue;
        //if (info.type == HighlightInfoType.INJECTED_LANGUAGE_FRAGMENT) continue;
        if (info.getSeverity().compareTo(HighlightSeverity.INFORMATION) <= 0) continue;
        result.add(Pair.create(file, info));
      }
    }
  }
  finally {
    progress.stop();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:DefaultHighlightVisitorBasedInspection.java

示例5: getDependencies

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public <T extends ProjectExternalDependency> List<T> getDependencies(@NotNull Class<T> aClass) {
  return ContainerUtil.collect(myDependencies.iterator(), FilteringIterator.instanceOf(aClass));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ExternalDependenciesManagerImpl.java

示例6: getChildren

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private List<Component> getChildren() {
  return ContainerUtil.collect(IJSwingUtilities.getChildren(myPanel));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:IJSwingUtilitiesTest.java

示例7: getAlreadyLoadedChildren

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public List<RepositoryTreeNode> getAlreadyLoadedChildren() {
  return ContainerUtil.collect(myChildren.iterator(), FilteringIterator.instanceOf(RepositoryTreeNode.class));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:RepositoryTreeNode.java


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