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


Java CommonProcessors.FindProcessor方法代码示例

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


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

示例1: findSuiteSymbol

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
@Nullable
private static OCStructSymbol findSuiteSymbol(Project project, String suite) {
  CommonProcessors.FindProcessor<OCSymbol> processor =
      new CommonProcessors.FindProcessor<OCSymbol>() {
        @Override
        protected boolean accept(OCSymbol symbol) {
          return symbol instanceof OCStructSymbol
              && CidrGoogleTestUtil.isGoogleTestClass((OCStructSymbol) symbol);
        }
      };
  OCGlobalProjectSymbolsCache.processTopLevelAndMemberSymbols(project, processor, suite);
  if (processor.isFound()) {
    return (OCStructSymbol) processor.getFoundValue();
  }
  Collection<OCStructSymbol> symbolsForSuite =
      CidrGoogleTestUtil.findGoogleTestSymbolsForSuiteSorted(project, suite);
  return Iterables.getFirst(symbolsForSuite, null);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:19,代码来源:BlazeCppTestLocator.java

示例2: findModuleDependency

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
private Optional<Library> findModuleDependency(Module module, VirtualFile sourceVF) {
    final CommonProcessors.FindProcessor<OrderEntry> processor = new CommonProcessors.FindProcessor<OrderEntry>() {

        @Override
        protected boolean accept(OrderEntry orderEntry) {
            final String[] urls = orderEntry.getUrls(OrderRootType.CLASSES);
            final boolean contains = Arrays.asList(urls).contains("jar://" + sourceVF.getPath() + "!/");
            return contains && orderEntry instanceof LibraryOrderEntry;
        }
    };
    ModuleRootManager.getInstance(module).orderEntries().forEach(processor);
    Library result = null;
    if (processor.getFoundValue() != null) {
        result = ((LibraryOrderEntry) processor.getFoundValue()).getLibrary();
    }
    return Optional.ofNullable(result);
}
 
开发者ID:bduisenov,项目名称:decompile-and-attach,代码行数:18,代码来源:DecompileAndAttachAction.java

示例3: isEntryPoint

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
@Override
public boolean isEntryPoint(@NotNull PsiElement psiElement) {
  if (ADD_JUNIT_TO_ENTRIES) {
    if (psiElement instanceof PsiClass) {
      final PsiClass aClass = (PsiClass)psiElement;
      if (JUnitUtil.isTestClass(aClass, false, true)) {
        if (!PsiClassUtil.isRunnableClass(aClass, true, true)) {
          final PsiClass topLevelClass = PsiTreeUtil.getTopmostParentOfType(aClass, PsiClass.class);
          if (topLevelClass != null && PsiClassUtil.isRunnableClass(topLevelClass, true, true)) {
            return true;
          }
          final CommonProcessors.FindProcessor<PsiClass> findProcessor = new CommonProcessors.FindProcessor<PsiClass>() {
            @Override
            protected boolean accept(PsiClass psiClass) {
              return !psiClass.hasModifierProperty(PsiModifier.ABSTRACT);
            }
          };
          return !ClassInheritorsSearch.search(aClass).forEach(findProcessor) && findProcessor.isFound();
        }
        return true;
      }
    }
    else if (psiElement instanceof PsiMethod) {
      final PsiMethod method = (PsiMethod)psiElement;
      if (method.isConstructor() && method.getParameterList().getParametersCount() == 0) {
        return JUnitUtil.isTestClass(method.getContainingClass());
      }
      if (JUnitUtil.isTestMethodOrConfig(method)) return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:JUnitEntryPoint.java

示例4: findUserLibrary

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
public static Library findUserLibrary(@NotNull Module module, @NotNull final String name) {
  CommonProcessors.FindProcessor<Library> processor = new CommonProcessors.FindProcessor<Library>() {
    @Override
    protected boolean accept(Library library) {
      String libraryName = library.getName();
      return libraryName != null && libraryName.startsWith(name);
    }
  };

  OrderEnumerator.orderEntries(module).forEachLibrary(processor);

  return processor.getFoundValue();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:MvcModuleStructureUtil.java

示例5: isEntryPoint

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
@Override
public boolean isEntryPoint(PsiElement psiElement) {
  if (ADD_JUNIT_TO_ENTRIES) {
    if (psiElement instanceof PsiClass) {
      final PsiClass aClass = (PsiClass)psiElement;
      if (JUnitUtil.isTestClass(aClass, false, true)) {
        if (!PsiClassUtil.isRunnableClass(aClass, true, true)) {
          final CommonProcessors.FindProcessor<PsiClass> findProcessor = new CommonProcessors.FindProcessor<PsiClass>() {
            @Override
            protected boolean accept(PsiClass psiClass) {
              return !psiClass.hasModifierProperty(PsiModifier.ABSTRACT);
            }
          };
          return !ClassInheritorsSearch.search(aClass).forEach(findProcessor) && findProcessor.isFound();
        }
        return true;
      }
    }
    else if (psiElement instanceof PsiMethod) {
      final PsiMethod method = (PsiMethod)psiElement;
      if (method.isConstructor() && method.getParameterList().getParametersCount() == 0) {
        return JUnitUtil.isTestClass(method.getContainingClass());
      }
      if (JUnitUtil.isTestMethodOrConfig(method)) return true;
    }
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:JUnitEntryPoint.java

示例6: forEachScript

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
@Override
public Script forEachScript(@NotNull CommonProcessors.FindProcessor<Script> scriptProcessor) {
  forEachScript(((Processor<Script>)scriptProcessor));
  return scriptProcessor.getFoundValue();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ScriptManagerBase.java

示例7: forEachScript

import com.intellij.util.CommonProcessors; //导入方法依赖的package包/类
@Nullable
Script forEachScript(@NotNull CommonProcessors.FindProcessor<Script> scriptProcessor);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ScriptManager.java


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