• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IdFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.util.indexing.IdFilter的典型用法代码示例。如果您正苦于以下问题:Java IdFilter类的具体用法?Java IdFilter怎么用?Java IdFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IdFilter类属于com.intellij.util.indexing包,在下文中一共展示了IdFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getNames

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
@NotNull
public String[] getNames(Project project, boolean includeNonProjectItems) {
  if (FileBasedIndex.ourEnableTracingOfKeyHashToVirtualFileMapping) {
    final THashSet<String> names = new THashSet<String>(1000);
    IdFilter filter = IdFilter.getProjectIdFilter(project, includeNonProjectItems);
    processNames(new Processor<String>() {
      @Override
      public boolean process(String s) {
        names.add(s);
        return true;
      }
    }, FindSymbolParameters.searchScopeFor(project, includeNonProjectItems), filter);
    if (IdFilter.LOG.isDebugEnabled()) {
      IdFilter.LOG.debug("All names retrieved2:" + names.size());
    }
    return ArrayUtil.toStringArray(names);
  } else {
    return FilenameIndex.getAllFilenames(project);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DefaultFileNavigationContributor.java


示例2: hasStubElementsOfType

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
public boolean hasStubElementsOfType(final DomFileElement domFileElement,
                                     final Class<? extends DomElement> clazz) {
  final VirtualFile file = domFileElement.getFile().getVirtualFile();
  if (!(file instanceof VirtualFileWithId)) return false;

  final String clazzName = clazz.getName();
  final int virtualFileId = ((VirtualFileWithId)file).getId();

  CommonProcessors.FindFirstProcessor<? super PsiFile> processor =
    new CommonProcessors.FindFirstProcessor<PsiFile>();
  StubIndex.getInstance().processElements(KEY, clazzName,
                                          domFileElement.getFile().getProject(),
                                          GlobalSearchScope.fileScope(domFileElement.getFile()),
                                          new IdFilter() {
                                            @Override
                                            public boolean containsFileId(int id) {
                                              return id == virtualFileId;
                                            }
                                          },
                                          PsiFile.class, 
                                          processor
  );

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


示例3: hasStubElementsWithNamespaceKey

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
public boolean hasStubElementsWithNamespaceKey(final DomFileElement domFileElement, final String namespaceKey) {
  final VirtualFile file = domFileElement.getFile().getVirtualFile();
  if (!(file instanceof VirtualFileWithId)) return false;

  final int virtualFileId = ((VirtualFileWithId)file).getId();
  CommonProcessors.FindFirstProcessor<PsiFile> processor = new CommonProcessors.FindFirstProcessor<PsiFile>();
  StubIndex.getInstance().processElements(
    KEY,
    namespaceKey,
    domFileElement.getFile().getProject(),
    GlobalSearchScope.fileScope(domFileElement.getFile()),
    new IdFilter() {
      @Override
      public boolean containsFileId(int id) {
        return id == virtualFileId;
      }
    },
    PsiFile.class, 
    processor
  );
  return processor.isFound();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DomNamespaceKeyIndex.java


示例4: ByItem

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
ByItem(final Converter converter,
       final Map<String,Set<String>> globalFields, final Map<String,Set<String>> globalMethods,
       final List<TypeNameItemNamePair> pairFields, final List<TypeNameItemNamePair> pairMethods,
       final List<Item> locals,
       final GlobalSearchScope scope, final IdFilter filter) {
  this.converter = converter;
  final ByItemMaps maps = JavaItems.valuesByItem(locals, true); // locals byItem map contains an entry for ObjectItem
  this.localValues = maps.values;
  this.localMethods = maps.methods;
  this.globalFields = globalFields;
  this.globalMethods = globalMethods;
  this.pairFields = pairFields;
  this.pairMethods = pairMethods;
  this.psiCache = PsiShortNamesCache.getInstance(converter.project);
  this.scope = scope;
  this.filter = filter;
}
 
开发者ID:eddysystems,项目名称:eddy,代码行数:18,代码来源:ByItem.java


示例5: getClassesByName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@NotNull
@Override
@RequiredReadAction
public PsiClass[] getClassesByName(@NotNull @NonNls String s, @NotNull GlobalSearchScope globalSearchScope)
{
	CommonProcessors.CollectProcessor<DotNetTypeDeclaration> collectProcessor = new CommonProcessors.CollectProcessor<DotNetTypeDeclaration>();
	DotNetShortNameSearcher.getInstance(myProject).collectTypes(s, globalSearchScope, IdFilter.getProjectIdFilter(myProject, false),
			collectProcessor);
	Collection<DotNetTypeDeclaration> results = collectProcessor.getResults();
	List<PsiClass> classes = new ArrayList<PsiClass>(results.size());
	for(DotNetTypeDeclaration dotNetTypeDeclaration : results)
	{
		JavaClassStubBuilder javaClassStubBuilder = StubBuilder.build(dotNetTypeDeclaration);
		if(javaClassStubBuilder == null)
		{
			continue;
		}
		classes.add(javaClassStubBuilder.buildToPsi(null));
	}
	return ContainerUtil.toArray(classes, PsiClass.ARRAY_FACTORY);
}
 
开发者ID:consulo,项目名称:consulo-ikvm,代码行数:22,代码来源:IkvmPsiShortNamesCache.java


示例6: processElementsWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public void processElementsWithName(
		@NotNull String name, @NotNull Processor<NavigationItem> navigationItemProcessor, @NotNull FindSymbolParameters findSymbolParameters)
{
	Project project = findSymbolParameters.getProject();
	IdFilter idFilter = findSymbolParameters.getIdFilter();
	GlobalSearchScope searchScope = findSymbolParameters.getSearchScope();

	StubIndex.getInstance().processElements(CSharpIndexKeys.METHOD_INDEX, name, project, searchScope, idFilter,
			DotNetLikeMethodDeclaration.class, (Processor) navigationItemProcessor);
	StubIndex.getInstance().processElements(CSharpIndexKeys.EVENT_INDEX, name, project, searchScope, idFilter,
			DotNetEventDeclaration.class,  (Processor) navigationItemProcessor);
	StubIndex.getInstance().processElements(CSharpIndexKeys.PROPERTY_INDEX, name, project, searchScope, idFilter,
			DotNetPropertyDeclaration.class, (Processor) navigationItemProcessor);
	StubIndex.getInstance().processElements(CSharpIndexKeys.FIELD_INDEX, name, project, searchScope, idFilter,
			DotNetFieldDeclaration.class, (Processor) navigationItemProcessor);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:18,代码来源:CSharpSymbolNameContributor.java


示例7: getNames

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
@Nonnull
public String[] getNames(Project project, boolean includeNonProjectItems) {
  if (FileBasedIndex.ourEnableTracingOfKeyHashToVirtualFileMapping) {
    final THashSet<String> names = new THashSet<String>(1000);
    IdFilter filter = IdFilter.getProjectIdFilter(project, includeNonProjectItems);
    processNames(new Processor<String>() {
      @Override
      public boolean process(String s) {
        names.add(s);
        return true;
      }
    }, FindSymbolParameters.searchScopeFor(project, includeNonProjectItems), filter);
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("All names retrieved2:" + names.size());
    }
    return ArrayUtil.toStringArray(names);
  } else {
    return FilenameIndex.getAllFilenames(project);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:DefaultFileNavigationContributor.java


示例8: hasStubElementsOfType

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
public boolean hasStubElementsOfType(final DomFileElement domFileElement, final Class<? extends DomElement> clazz)
{
	final VirtualFile file = domFileElement.getFile().getVirtualFile();
	if(!(file instanceof VirtualFileWithId))
	{
		return false;
	}

	final String clazzName = clazz.getName();
	final int virtualFileId = ((VirtualFileWithId) file).getId();

	CommonProcessors.FindFirstProcessor<? super PsiFile> processor = new CommonProcessors.FindFirstProcessor<PsiFile>();
	StubIndex.getInstance().process(KEY, clazzName, domFileElement.getFile().getProject(), GlobalSearchScope.fileScope(domFileElement.getFile())
			, new IdFilter()
	{
		@Override
		public boolean containsFileId(int id)
		{
			return id == virtualFileId;
		}
	}, processor);

	return processor.isFound();
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:25,代码来源:DomElementClassIndex.java


示例9: hasStubElementsWithNamespaceKey

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
public boolean hasStubElementsWithNamespaceKey(final DomFileElement domFileElement, final String namespaceKey)
{
	final VirtualFile file = domFileElement.getFile().getVirtualFile();
	if(!(file instanceof VirtualFileWithId))
	{
		return false;
	}

	final int virtualFileId = ((VirtualFileWithId) file).getId();
	CommonProcessors.FindFirstProcessor<PsiFile> processor = new CommonProcessors.FindFirstProcessor<PsiFile>();
	StubIndex.getInstance().process(KEY, namespaceKey, domFileElement.getFile().getProject(), GlobalSearchScope.fileScope(domFileElement.getFile
			()), new IdFilter()
	{
		@Override
		public boolean containsFileId(int id)
		{
			return id == virtualFileId;
		}
	}, processor);
	return processor.isFound();
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:22,代码来源:DomNamespaceKeyIndex.java


示例10: processFieldsWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processFieldsWithName(@NotNull String name,
                                     @NotNull Processor<? super PsiField> processor,
                                     @NotNull GlobalSearchScope scope,
                                     @Nullable IdFilter filter) {
  return StubIndex.getInstance().processElements(JavaStubIndexKeys.FIELDS, name, myManager.getProject(), new JavaSourceFilterScope(scope),
                                                 filter, PsiField.class, processor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PsiShortNamesCacheImpl.java


示例11: processMethodsWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processMethodsWithName(@NonNls @NotNull String name,
                                      @NotNull Processor<? super PsiMethod> processor,
                                      @NotNull GlobalSearchScope scope,
                                      @Nullable IdFilter filter) {
  return StubIndex.getInstance().processElements(JavaStubIndexKeys.METHODS, name, myManager.getProject(),
                                                 new JavaSourceFilterScope(scope), filter, PsiMethod.class, processor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PsiShortNamesCacheImpl.java


示例12: processClassesWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processClassesWithName(@NotNull String name,
                                      @NotNull Processor<? super PsiClass> processor,
                                      @NotNull GlobalSearchScope scope,
                                      @Nullable IdFilter filter) {
  return StubIndex.getInstance().processElements(JavaStubIndexKeys.CLASS_SHORT_NAMES, name, myManager.getProject(),
                                                 new JavaSourceFilterScope(scope), filter, PsiClass.class, processor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:PsiShortNamesCacheImpl.java


示例13: processClassNames

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
public static Project processClassNames(final Project project, final GlobalSearchScope scope, final Consumer<String> consumer) {
  final ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator();

  MethodUsagesSearcher.resolveInReadAction(project, new Computable<Void>() {
    @Override
    public Void compute() {
      PsiShortNamesCache.getInstance(project).processAllClassNames(new Processor<String>() {
        int i = 0;

        @Override
        public boolean process(String s) {
          if (indicator != null && i++ % 512 == 0) {
            indicator.checkCanceled();
          }
          consumer.consume(s);
          return true;
        }
      }, scope, IdFilter.getProjectIdFilter(project, true));
      return null;
    }
  });

  if (indicator != null) {
    indicator.checkCanceled();
  }
  return project;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:AllClassesSearchExecutor.java


示例14: processAllClassNames

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processAllClassNames(Processor<String> processor, GlobalSearchScope scope, IdFilter filter) {
  for (PsiShortNamesCache cache : myCaches) {
    if (!cache.processAllClassNames(processor, scope, filter)) {
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CompositeShortNamesCache.java


示例15: processAllMethodNames

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processAllMethodNames(Processor<String> processor, GlobalSearchScope scope, IdFilter filter) {
  for (PsiShortNamesCache cache : myCaches) {
    if (!cache.processAllMethodNames(processor, scope, filter)) {
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CompositeShortNamesCache.java


示例16: processAllFieldNames

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processAllFieldNames(Processor<String> processor, GlobalSearchScope scope, IdFilter filter) {
  for (PsiShortNamesCache cache : myCaches) {
    if (!cache.processAllFieldNames(processor, scope, filter)) {
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CompositeShortNamesCache.java


示例17: processMethodsWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processMethodsWithName(@NonNls @NotNull String name,
                                      @NotNull Processor<? super PsiMethod> processor,
                                      @NotNull GlobalSearchScope scope,
                                      @Nullable IdFilter idFilter) {
  for (PsiShortNamesCache cache : myCaches) {
    if (!cache.processMethodsWithName(name, processor, scope, idFilter)) return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CompositeShortNamesCache.java


示例18: processFieldsWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processFieldsWithName(@NotNull String key,
                                     @NotNull Processor<? super PsiField> processor,
                                     @NotNull GlobalSearchScope scope,
                                     @Nullable IdFilter filter) {
  for (PsiShortNamesCache cache : myCaches) {
    if (!cache.processFieldsWithName(key, processor, scope, filter)) return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CompositeShortNamesCache.java


示例19: processClassesWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
@Override
public boolean processClassesWithName(@NotNull String key,
                                      @NotNull Processor<? super PsiClass> processor,
                                      @NotNull GlobalSearchScope scope,
                                      @Nullable IdFilter filter) {
  for (PsiShortNamesCache cache : myCaches) {
    if (!cache.processClassesWithName(key, processor, scope, filter)) return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CompositeShortNamesCache.java


示例20: processMethodsWithName

import com.intellij.util.indexing.IdFilter; //导入依赖的package包/类
public boolean processMethodsWithName(@NonNls @NotNull String name, @NotNull final Processor<? super PsiMethod> processor,
                                               @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) {
  return processMethodsWithName(name, scope, new Processor<PsiMethod>() {
    @Override
    public boolean process(PsiMethod method) {
      return processor.process(method);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PsiShortNamesCache.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProjectBundle类代码示例发布时间:2022-05-22
下一篇:
Java InvalidSettingsException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap