本文整理汇总了Java中com.intellij.util.indexing.FindSymbolParameters类的典型用法代码示例。如果您正苦于以下问题:Java FindSymbolParameters类的具体用法?Java FindSymbolParameters怎么用?Java FindSymbolParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FindSymbolParameters类属于com.intellij.util.indexing包,在下文中一共展示了FindSymbolParameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getNames
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的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: getElementsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@NotNull
@Override
public Object[] getElementsByName(String name, FindSymbolParameters parameters, @NotNull ProgressIndicator canceled) {
String patternName = parameters.getLocalPatternName();
List<T> classes = myTreeClassChooserDialog.getClassesByName(
name, parameters.isSearchInLibraries(), patternName, myTreeClassChooserDialog.getScope()
);
if (classes.size() == 0) return ArrayUtil.EMPTY_OBJECT_ARRAY;
if (classes.size() == 1) {
return isAccepted(classes.get(0)) ? ArrayUtil.toObjectArray(classes) : ArrayUtil.EMPTY_OBJECT_ARRAY;
}
Set<String> qNames = ContainerUtil.newHashSet();
List<T> list = new ArrayList<T>(classes.size());
for (T aClass : classes) {
if (qNames.add(getFullName(aClass)) && isAccepted(aClass)) {
list.add(aClass);
}
}
return ArrayUtil.toObjectArray(list);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractTreeClassChooserDialog.java
示例3: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name,
@NotNull final Processor<NavigationItem> processor,
@NotNull FindSymbolParameters parameters) {
final MinusculeMatcher matcher = NameUtil.buildMatcher(parameters.getCompletePattern(), NameUtil.MatchingCaseSensitivity.FIRST_LETTER);
if (!matcher.isStartMatch(name.substring(0, name.lastIndexOf(':')))) return;
String[] names = name.split(":");
MavenId mavenId = new MavenId(names[0], names[1], names[2]);
projectsManager = MavenProjectsManager.getInstance(project);
MavenProject p = projectsManager.findProject(mavenId);
PsiFileSystemItem pomFile = null;
if (p != null) {
pomFile = PsiManager.getInstance(project).findFile(p.getFile());
} else if (parameters.isSearchInLibraries()) {
Map<MavenId, PsiFile> notImportPoms = getNotImportPoms(projectsManager.getRootProjects().get(0));
pomFile = notImportPoms.get(mavenId);
}
if (pomFile != null) {
PomWrapper pomWrapper = new PomWrapper(pomFile, mavenId, project.getBasePath(), showPomLocation);
processor.process(pomWrapper);
}
}
开发者ID:shlxue,项目名称:MvnRunner,代码行数:25,代码来源:PomNavigationContributor.java
示例4: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的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
示例5: getNames
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的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
示例6: getElementsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Nonnull
@Override
public Object[] getElementsByName(String name, FindSymbolParameters parameters, @Nonnull ProgressIndicator canceled) {
String patternName = parameters.getLocalPatternName();
List<T> classes = myTreeClassChooserDialog.getClassesByName(name, parameters.isSearchInLibraries(), patternName, myTreeClassChooserDialog.getScope());
if (classes.size() == 0) return ArrayUtil.EMPTY_OBJECT_ARRAY;
if (classes.size() == 1) {
return isAccepted(classes.get(0)) ? ArrayUtil.toObjectArray(classes) : ArrayUtil.EMPTY_OBJECT_ARRAY;
}
Set<String> qNames = ContainerUtil.newHashSet();
List<T> list = new ArrayList<T>(classes.size());
for (T aClass : classes) {
if (qNames.add(getFullName(aClass)) && isAccepted(aClass)) {
list.add(aClass);
}
}
return ArrayUtil.toObjectArray(list);
}
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:AbstractTreeClassChooserDialog.java
示例7: getItemsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
@NotNull
public NavigationItem[] getItemsByName(String name, final String pattern, Project project, boolean includeNonProjectItems) {
CommonProcessors.CollectProcessor<NavigationItem> processor = new CommonProcessors.CollectProcessor<NavigationItem>();
processElementsWithName(name, processor, FindSymbolParameters.wrap(pattern, project, includeNonProjectItems));
return processor.toArray(new NavigationItem[processor.getResults().size()]);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DefaultClassNavigationContributor.java
示例8: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name,
@NotNull final Processor<NavigationItem> processor,
@NotNull final FindSymbolParameters parameters) {
String namePattern = StringUtil.getShortName(parameters.getCompletePattern());
boolean hasDollar = namePattern.contains("$");
if (hasDollar) {
Matcher matcher = ChooseByNamePopup.patternToDetectAnonymousClasses.matcher(namePattern);
if (matcher.matches()) {
namePattern = matcher.group(1);
hasDollar = namePattern.contains("$");
}
}
final MinusculeMatcher innerMatcher = hasDollar ? new MinusculeMatcher("*" + namePattern, NameUtil.MatchingCaseSensitivity.NONE) : null;
PsiShortNamesCache.getInstance(parameters.getProject()).processClassesWithName(name, new Processor<PsiClass>() {
final boolean isAnnotation = parameters.getLocalPatternName().startsWith("@");
@Override
public boolean process(PsiClass aClass) {
if (aClass.getContainingFile().getVirtualFile() == null || !aClass.isPhysical()) return true;
if (isAnnotation && !aClass.isAnnotationType()) return true;
if (innerMatcher != null) {
if (aClass.getContainingClass() == null) return true;
String jvmQName = ClassUtil.getJVMClassName(aClass);
if (jvmQName == null || !innerMatcher.matches(StringUtil.getShortName(jvmQName))) return true;
}
return processor.process(aClass);
}
}, parameters.getSearchScope(), parameters.getIdFilter());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:DefaultClassNavigationContributor.java
示例9: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name,
@NotNull final Processor<NavigationItem> _processor,
@NotNull FindSymbolParameters parameters) {
final boolean globalSearch = parameters.getSearchScope().isSearchInLibraries();
final Processor<PsiFileSystemItem> processor = new Processor<PsiFileSystemItem>() {
@Override
public boolean process(PsiFileSystemItem item) {
if (!globalSearch && ProjectUtil.isProjectOrWorkspaceFile(item.getVirtualFile())) {
return true;
}
return _processor.process(item);
}
};
String completePattern = parameters.getCompletePattern();
final boolean includeDirs = completePattern.endsWith("/") || completePattern.endsWith("\\") ||
completePattern.startsWith("/") || completePattern.startsWith("\\");
boolean result = FilenameIndex.processFilesByName(
name, includeDirs, processor, parameters.getSearchScope(), parameters.getProject(), parameters.getIdFilter()
);
if (!result && includeDirs) {
FilenameIndex.processFilesByName(
name, false, processor, parameters.getSearchScope(), parameters.getProject(), parameters.getIdFilter()
);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:DefaultFileNavigationContributor.java
示例10: getItemsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@NotNull
@Override
public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems)
{
CommonProcessors.CollectProcessor<NavigationItem> processor = new CommonProcessors.CollectProcessor<NavigationItem>(ContainerUtil.<NavigationItem>newTroveSet());
processElementsWithName(name, processor, new FindSymbolParameters(pattern, name, GlobalSearchScope.allScope(project), IdFilter.getProjectIdFilter(project, includeNonProjectItems)));
return processor.toArray(NavigationItem.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:9,代码来源:UnityScriptGotoClassContributor.java
示例11: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name, @NotNull final Processor<NavigationItem> processor, @NotNull FindSymbolParameters parameters)
{
StubIndex.getInstance().processElements(UnityScriptIndexKeys.FILE_BY_NAME_INDEX, name, parameters.getProject(), parameters.getSearchScope(), parameters.getIdFilter(), JSFile.class,
new Processor<JSFile>()
{
@Override
public boolean process(final JSFile file)
{
return processor.process(new FakePsiElement()
{
@Override
public String getName()
{
return FileUtil.getNameWithoutExtension(file.getName());
}
@Nullable
@Override
public Icon getIcon(boolean open)
{
IconDescriptor descriptor = new IconDescriptor(AllIcons.Nodes.Class);
descriptor.addLayerIcon(Unity3dIcons.Js);
descriptor.setRightIcon(AllIcons.Nodes.C_public);
return descriptor.toIcon();
}
@Override
public PsiElement getParent()
{
return file;
}
});
}
});
}
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:37,代码来源:UnityScriptGotoClassContributor.java
示例12: getItemsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@NotNull
@Override
public NavigationItem[] getItemsByName(String name, final String pattern, Project project, boolean includeNonProjectItems) {
CommonProcessors.CollectProcessor<NavigationItem> processor = new CommonProcessors.CollectProcessor<NavigationItem>();
processElementsWithName(name, processor, FindSymbolParameters.wrap(pattern, project, includeNonProjectItems));
return processor.toArray(new NavigationItem[processor.getResults().size()]);
}
开发者ID:shlxue,项目名称:MvnRunner,代码行数:8,代码来源:PomNavigationContributor.java
示例13: getItemsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@NotNull
@Override
@RequiredReadAction
public NavigationItem[] getItemsByName(String name, final String pattern, Project project, boolean includeNonProjectItems)
{
CommonProcessors.CollectProcessor<NavigationItem> processor = new CommonProcessors.CollectProcessor<NavigationItem>(ContainerUtil.<NavigationItem>newTroveSet());
processElementsWithName(name, processor, new FindSymbolParameters(pattern, name, GlobalSearchScope.allScope(project), IdFilter.getProjectIdFilter(project, includeNonProjectItems)));
return processor.toArray(NavigationItem.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:10,代码来源:CSharpTypeNameContributor.java
示例14: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name, @NotNull final Processor<NavigationItem> navigationItemProcessor, @NotNull FindSymbolParameters findSymbolParameters)
{
Project project = findSymbolParameters.getProject();
IdFilter idFilter = findSymbolParameters.getIdFilter();
Processor temp = navigationItemProcessor;
GlobalSearchScope searchScope = findSymbolParameters.getSearchScope();
StubIndex.getInstance().processElements(CSharpIndexKeys.TYPE_INDEX, name, project, searchScope, idFilter, CSharpTypeDeclaration.class, temp);
StubIndex.getInstance().processElements(CSharpIndexKeys.DELEGATE_METHOD_BY_NAME_INDEX, name, project, searchScope, idFilter, CSharpMethodDeclaration.class, temp);
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpTypeNameContributor.java
示例15: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@NotNull String name, @NotNull final Processor<NavigationItem> processor, @NotNull FindSymbolParameters parameters)
{
StubIndex.getInstance().processElements(MsilIndexKeys.TYPE_BY_NAME_INDEX, name, parameters.getProject(), parameters.getSearchScope(), parameters.getIdFilter(), MsilClassEntry.class,
msilClassEntry ->
{
ProgressManager.checkCanceled();
return processor.process(new NavigatableWithRepresentation(msilClassEntry));
});
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:11,代码来源:MsilGotoClassContributor.java
示例16: getItemsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@NotNull
@Override
public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems)
{
CommonProcessors.CollectProcessor<NavigationItem> processor = new CommonProcessors.CollectProcessor<>(ContainerUtil.<NavigationItem>newTroveSet());
processElementsWithName(name, processor, new FindSymbolParameters(pattern, name, GlobalSearchScope.allScope(project), IdFilter.getProjectIdFilter(project, includeNonProjectItems)));
return processor.toArray(NavigationItem.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:9,代码来源:MsilGotoClassContributor.java
示例17: getItemsByName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
@Nonnull
public NavigationItem[] getItemsByName(String name, final String pattern, Project project, boolean includeNonProjectItems) {
CommonProcessors.CollectProcessor<NavigationItem> processor = new CommonProcessors.CollectProcessor<NavigationItem>();
processElementsWithName(name, processor, FindSymbolParameters.wrap(pattern, project, includeNonProjectItems));
return processor.toArray(NavigationItem.ARRAY_FACTORY);
}
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:DefaultFileNavigationContributor.java
示例18: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
@Override
public void processElementsWithName(@Nonnull String name,
@Nonnull Processor<NavigationItem> processor,
@Nonnull FindSymbolParameters parameters) {
String completePattern = parameters.getCompletePattern();
final boolean includeDirs = completePattern.endsWith("/") || completePattern.endsWith("\\") ||
completePattern.startsWith("/") || completePattern.startsWith("\\");
boolean result = FilenameIndex.processFilesByName(name, includeDirs, processor, parameters.getSearchScope(), parameters.getIdFilter());
if (!result && includeDirs) {
FilenameIndex.processFilesByName(name, false, processor, parameters.getSearchScope(), parameters.getIdFilter());
}
}
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:DefaultFileNavigationContributor.java
示例19: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
void processElementsWithName(@NotNull String name,
@NotNull Processor<NavigationItem> processor,
@NotNull FindSymbolParameters parameters);
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ChooseByNameContributorEx.java
示例20: processElementsWithName
import com.intellij.util.indexing.FindSymbolParameters; //导入依赖的package包/类
void processElementsWithName(@Nonnull String name,
@Nonnull Processor<NavigationItem> processor,
@Nonnull FindSymbolParameters parameters);
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ChooseByNameContributorEx.java
注:本文中的com.intellij.util.indexing.FindSymbolParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论