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


Java Processor.process方法代码示例

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


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

示例1: filterElements

import com.intellij.util.Processor; //导入方法依赖的package包/类
@Override
public boolean filterElements(@NotNull ChooseByNameBase base, @NotNull String pattern, boolean everywhere, @NotNull ProgressIndicator indicator, @NotNull Processor<Object> consumer) {
    Collection<SearchResultElement> elements = getAllFilterItems();

    if (elements != null) {
        for (SearchResultElement element : elements) {
            String value = element.getValue();

            if (value == null) {
                return false;
            }

            if (value.toLowerCase().contains(pattern.toLowerCase()) && !consumer.process(element)) {
                return false;
            }
        }
    }

    return false;
}
 
开发者ID:hoai265,项目名称:SearchResourcePlugin,代码行数:21,代码来源:SearchResultItemProvider.java

示例2: processChildrenOfType

import com.intellij.util.Processor; //导入方法依赖的package包/类
/**
 * Walk through entire PSI tree rooted at 'element', processing all children of the given type.
 *
 * @return true if processing was stopped by the processor
 */
private static <T extends PsiElement> boolean processChildrenOfType(
    PsiElement element, Processor<T> processor, Class<T> psiClass, boolean reverseOrder) {
  PsiElement child = reverseOrder ? element.getLastChild() : element.getFirstChild();
  while (child != null) {
    if (psiClass.isInstance(child)) {
      if (!processor.process((T) child)) {
        return true;
      }
    }
    if (processChildrenOfType(child, processor, psiClass, reverseOrder)) {
      return true;
    }
    child = reverseOrder ? child.getPrevSibling() : child.getNextSibling();
  }
  return false;
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:PsiUtils.java

示例3: processClassesByNames

import com.intellij.util.Processor; //导入方法依赖的package包/类
public static boolean processClassesByNames(Project project,
                                            final GlobalSearchScope scope,
                                            Collection<String> names,
                                            Processor<PsiClass> processor) {
  final PsiShortNamesCache cache = PsiShortNamesCache.getInstance(project);
  for (final String name : names) {
    ProgressIndicatorProvider.checkCanceled();
    final PsiClass[] classes = MethodUsagesSearcher.resolveInReadAction(project, new Computable<PsiClass[]>() {
      @Override
      public PsiClass[] compute() {
        return cache.getClassesByName(name, scope);
      }
    });
    for (PsiClass psiClass : classes) {
      ProgressIndicatorProvider.checkCanceled();
      if (!processor.process(psiClass)) {
        return false;
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AllClassesSearchExecutor.java

示例4: processWsdlSchemas

import com.intellij.util.Processor; //导入方法依赖的package包/类
public static void processWsdlSchemas(final XmlTag rootTag, Processor<XmlTag> processor) {
  if ("definitions".equals(rootTag.getLocalName())) {
    final String nsPrefix = rootTag.getNamespacePrefix();
    final String types = nsPrefix.isEmpty() ? "types" : nsPrefix  + ":types";
    final XmlTag subTag = rootTag.findFirstSubTag(types);

    if (subTag != null) {
      for (int i = 0; i < XmlUtil.SCHEMA_URIS.length; i++) {
        final XmlTag[] tags = subTag.findSubTags("schema", XmlUtil.SCHEMA_URIS[i]);
        for (XmlTag t : tags) {
          if (!processor.process(t)) return;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:URLReference.java

示例5: processLocalCalls

import com.intellij.util.Processor; //导入方法依赖的package包/类
private static void processLocalCalls(@NotNull PyFunction function, @NotNull Processor<PyCallExpression> processor) {
  final PsiFile file = function.getContainingFile();
  final String name = function.getName();
  if (file != null && name != null) {
    // Text search is faster than ReferencesSearch in LocalSearchScope
    final String text = file.getText();
    for (int pos = text.indexOf(name); pos != -1; pos = text.indexOf(name, pos + 1)) {
      final PsiReference ref = file.findReferenceAt(pos);
      if (ref != null && ref.isReferenceTo(function)) {
        final PyCallExpression expr = PsiTreeUtil.getParentOfType(file.findElementAt(pos), PyCallExpression.class);
        if (expr != null && !processor.process(expr)) {
          return;
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PyNamedParameterImpl.java

示例6: processEnumerationValues

import com.intellij.util.Processor; //导入方法依赖的package包/类
/**
 * @return true if enumeration is exhaustive
 */
public static boolean processEnumerationValues(final XmlTag element, final Processor<XmlTag> tagProcessor) {
  boolean exhaustiveEnum = true;

  for (final XmlTag tag : element.getSubTags()) {
    @NonNls final String localName = tag.getLocalName();

    if (localName.equals(ENUMERATION_TAG_NAME)) {
      final String attributeValue = tag.getAttributeValue(VALUE_ATTR_NAME);
      if (attributeValue != null) {
        if (!tagProcessor.process(tag)) {
          return exhaustiveEnum;
        }
      }
    }
    else if (localName.equals("union")) {
      exhaustiveEnum = false;
      processEnumerationValues(tag, tagProcessor);
    }
    else if (!doNotVisitTags.contains(localName)) {
      // don't go into annotation
      exhaustiveEnum &= processEnumerationValues(tag, tagProcessor);
    }
  }
  return exhaustiveEnum;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:XmlUtil.java

示例7: processChildrenRecursively

import com.intellij.util.Processor; //导入方法依赖的package包/类
public static void processChildrenRecursively(@Nullable MavenDomProjectModel model,
                                              @NotNull Processor<MavenDomProjectModel> processor,
                                              @NotNull Project project,
                                              @NotNull Set<MavenDomProjectModel> processedModels,
                                              boolean strict) {
  if (model != null && !processedModels.contains(model)) {
    processedModels.add(model);

    if (strict && processor.process(model)) return;

    MavenProject mavenProject = MavenDomUtil.findProject(model);
    if (mavenProject != null) {
      for (MavenProject childProject : MavenProjectsManager.getInstance(project).findInheritors(mavenProject)) {
        MavenDomProjectModel childProjectModel = MavenDomUtil.getMavenDomProjectModel(project, childProject.getFile());

        processChildrenRecursively(childProjectModel, processor, project, processedModels, true);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:MavenDomProjectProcessorUtils.java

示例8: processSameNamedClasses

import com.intellij.util.Processor; //导入方法依赖的package包/类
private static boolean processSameNamedClasses(Processor<PsiClass> consumer, List<PsiClass> sameNamedClasses, final VirtualFile jarFile) {
  // if there is a class from the same jar, prefer it
  boolean sameJarClassFound = false;

  if (jarFile != null && sameNamedClasses.size() > 1) {
    for (PsiClass sameNamedClass : sameNamedClasses) {
      ProgressManager.checkCanceled();
      boolean fromSameJar = Comparing.equal(getJarFile(sameNamedClass), jarFile);
      if (fromSameJar) {
        sameJarClassFound = true;
        if (!consumer.process(sameNamedClass)) return false;
      }
    }
  }

  return sameJarClassFound || ContainerUtil.process(sameNamedClasses, consumer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaDirectInheritorsSearcher.java

示例9: processNames

import com.intellij.util.Processor; //导入方法依赖的package包/类
@Override
public void processNames(final Processor<String> nameProcessor, boolean checkBoxState) {
  if (myFastMode) {
    myFastMode = myInheritorsProvider.searchForInheritorsOfBaseClass().forEach(new Processor<T>() {
      private long start = System.currentTimeMillis();

      @Override
      public boolean process(T aClass) {
        if (System.currentTimeMillis() - start > 500) {
          return false;
        }
        if ((getTreeClassChooserDialog().getFilter().isAccepted(aClass)) && aClass.getName() != null) {
          nameProcessor.process(aClass.getName());
        }
        return true;
      }
    });
  }
  if (!myFastMode) {
    for (String name : myInheritorsProvider.getNames()) {
      nameProcessor.process(name);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AbstractTreeClassChooserDialog.java

示例10: processSelectedIncompleteProperties

import com.intellij.util.Processor; //导入方法依赖的package包/类
private static boolean processSelectedIncompleteProperties(final @NotNull Processor<IProperty> processor,
                                                           final @NotNull ResourceBundleEditor resourceBundleEditor,
                                                           final @NotNull Project project) {
  final IgnoredPropertiesFilesSuffixesManager suffixesManager = IgnoredPropertiesFilesSuffixesManager.getInstance(project);
  for (ResourceBundleEditorViewElement element : resourceBundleEditor.getSelectedElements()) {
    final IProperty[] properties = element.getProperties();
    if (properties != null) {
      for (IProperty property : properties) {
        if (!suffixesManager.isPropertyComplete(resourceBundleEditor.getResourceBundle(), property.getKey()) && !processor.process(property)) {
          return false;
        }
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IgnoreIncompletePropertyPropertiesFilesAction.java

示例11: processFilesRecursively

import com.intellij.util.Processor; //导入方法依赖的package包/类
public static void processFilesRecursively(@NotNull VirtualFile root,
                                           @NotNull Processor<VirtualFile> processor,
                                           @NotNull Convertor<VirtualFile, Boolean> directoryFilter) {
  if (!processor.process(root)) return;

  if (root.isDirectory() && directoryFilter.convert(root)) {
    final LinkedList<VirtualFile[]> queue = new LinkedList<VirtualFile[]>();

    queue.add(root.getChildren());

    do {
      final VirtualFile[] files = queue.removeFirst();

      for (VirtualFile file : files) {
        if (!processor.process(file)) return;
        if (file.isDirectory() && directoryFilter.convert(file)) {
          queue.add(file.getChildren());
        }
      }
    } while (!queue.isEmpty());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:VfsUtilCore.java

示例12: _process

import com.intellij.util.Processor; //导入方法依赖的package包/类
private static boolean _process(VirtualFile[] files, Project project, Processor<XmlFile> processor) {
  final PsiManager psiManager = PsiManager.getInstance(project);
  final PsiFile[] psiFiles = ContainerUtil.map2Array(files, PsiFile.class, new NullableFunction<VirtualFile, PsiFile>() {
    public PsiFile fun(VirtualFile file) {
      return psiManager.findFile(file);
    }
  });
  for (final PsiFile psiFile : psiFiles) {
    if (XsltSupport.isXsltFile(psiFile)) {
      if (!processor.process((XmlFile)psiFile)) {
        return false;
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:XsltIncludeIndex.java

示例13: processClassAndPackagesNames

import com.intellij.util.Processor; //导入方法依赖的package包/类
private static void processClassAndPackagesNames(String qName, final Processor<WordOccurrence> processor) {
  WordOccurrence occurrence = new WordOccurrence(qName, 0, qName.length(), WordOccurrence.Kind.FOREIGN_LANGUAGE);
  processor.process(occurrence);
  int idx = qName.lastIndexOf('.');
  
  while (idx > 0) {
    qName = qName.substring(0, idx);
    occurrence.init(qName, 0,qName.length(),WordOccurrence.Kind.FOREIGN_LANGUAGE);
    processor.process(occurrence);
    idx = qName.lastIndexOf('.');
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:FormWordsScanner.java

示例14: findLinkStylesheets

import com.intellij.util.Processor; //导入方法依赖的package包/类
public static void findLinkStylesheets(@NotNull final XmlTag tag,
                                       @NotNull Processor<XmlTag> tagProcessor) {
  processInjectedContent(tag, tagProcessor);

  for (XmlTag subTag : tag.getSubTags()) {
    findLinkStylesheets(subTag, tagProcessor);
  }

  if (LINK.equalsIgnoreCase(tag.getName())) {
    tagProcessor.process(tag);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HtmlLinkUtil.java

示例15: doTest

import com.intellij.util.Processor; //导入方法依赖的package包/类
private void doTest(@NonNls String text, Processor<PsiFile> run) {
  PsiFile file = myFixture.configureByText(JavaFileType.INSTANCE, text);
  PsiModificationTracker modificationTracker = PsiManager.getInstance(getProject()).getModificationTracker();
  long count = modificationTracker.getModificationCount();
  run.process(file);
  assertFalse(modificationTracker.getModificationCount() == count);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PsiModificationTrackerTest.java


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