當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。