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


Java FindUsagesHandler.getFindUsagesOptions方法代码示例

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


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

示例1: findTagUsage

import com.intellij.find.findUsages.FindUsagesHandler; //导入方法依赖的package包/类
private int findTagUsage(XmlTag element) {
    final FindUsagesHandler handler = FindUsageUtils.getFindUsagesHandler(element, element.getProject());
    if (handler != null) {
        final FindUsagesOptions findUsagesOptions = handler.getFindUsagesOptions();
        final PsiElement[] primaryElements = handler.getPrimaryElements();
        final PsiElement[] secondaryElements = handler.getSecondaryElements();
        Factory factory = new Factory() {
            public UsageSearcher create() {
                return FindUsageUtils.createUsageSearcher(primaryElements, secondaryElements, handler, findUsagesOptions, (PsiFile) null);
            }
        };
        UsageSearcher usageSearcher = (UsageSearcher)factory.create();
        final AtomicInteger mCount = new AtomicInteger(0);
        usageSearcher.generate(new Processor<Usage>() {
            @Override
            public boolean process(Usage usage) {
                if (ResourceUsageCountUtils.isUsefulUsageToCount(usage)) {
                    mCount.incrementAndGet();
                }
                return true;
            }
        });
        return mCount.get();
    }
    return 0;
}
 
开发者ID:niorgai,项目名称:Android-Resource-Usage-Count,代码行数:27,代码来源:UsageCountLineProvider.java

示例2: findUsages

import com.intellij.find.findUsages.FindUsagesHandler; //导入方法依赖的package包/类
@NotNull
public Collection<UsageInfo> findUsages(@NotNull final PsiElement targetElement, @Nullable SearchScope scope) {
  final Project project = getProject();
  final FindUsagesHandler handler =
    ((FindManagerImpl)FindManager.getInstance(project)).getFindUsagesManager().getFindUsagesHandler(targetElement, false);

  final CommonProcessors.CollectProcessor<UsageInfo> processor = new CommonProcessors.CollectProcessor<UsageInfo>();
  Assert.assertNotNull("Cannot find handler for: " + targetElement, handler);
  final PsiElement[] psiElements = ArrayUtil.mergeArrays(handler.getPrimaryElements(), handler.getSecondaryElements());
  final FindUsagesOptions options = handler.getFindUsagesOptions(null);
  if (scope != null) options.searchScope = scope; 
  for (PsiElement psiElement : psiElements) {
    handler.processElementUsages(psiElement, processor, options);
  }
  return processor.getResults();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CodeInsightTestFixtureImpl.java

示例3: findUsages

import com.intellij.find.findUsages.FindUsagesHandler; //导入方法依赖的package包/类
private static Collection<UsageInfo> findUsages(@NotNull final PsiElement element) {
  final FindUsagesHandler handler = createFindUsageHandler(element);
  if (handler == null) {
    return Lists.newArrayList();
  }
  final CommonProcessors.CollectProcessor<UsageInfo> processor = new CommonProcessors.CollectProcessor<UsageInfo>();
  final PsiElement[] psiElements = ArrayUtil.mergeArrays(handler.getPrimaryElements(), handler.getSecondaryElements());
  final FindUsagesOptions options = handler.getFindUsagesOptions(null);
  for (PsiElement psiElement : psiElements) {
    handler.processElementUsages(psiElement, processor, options);
  }
  return processor.getResults();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:PyStaticCallHierarchyUtil.java

示例4: getDefaultOptions

import com.intellij.find.findUsages.FindUsagesHandler; //导入方法依赖的package包/类
@NotNull
private static FindUsagesOptions getDefaultOptions(@NotNull FindUsagesHandler handler) {
  FindUsagesOptions options =
      handler.getFindUsagesOptions(DataManager.getInstance().getDataContext());
  // by default, scope in FindUsagesOptions is copied from the FindSettings, but we need a default one
  options.searchScope = FindUsagesManager.getMaximalScope(handler);
  return options;
}
 
开发者ID:square,项目名称:dagger-intellij-plugin,代码行数:9,代码来源:ShowUsagesAction.java

示例5: getDefaultOptions

import com.intellij.find.findUsages.FindUsagesHandler; //导入方法依赖的package包/类
@NotNull
private static FindUsagesOptions getDefaultOptions(@NotNull FindUsagesHandler handler) {
  FindUsagesOptions options = handler.getFindUsagesOptions(DataManager.getInstance().getDataContext());
  // by default, scope in FindUsagesOptions is copied from the FindSettings, but we need a default one
  options.searchScope = FindUsagesManager.getMaximalScope(handler);
  return options;
}
 
开发者ID:square,项目名称:otto-intellij-plugin,代码行数:8,代码来源:ShowUsagesAction.java


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