com.intellij.navigation.ChooseByNameContributor Java Examples
The following examples show how to use
com.intellij.navigation.ChooseByNameContributor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GotoSymbolModel2.java From consulo with Apache License 2.0 | 6 votes |
@Override public String getFullName(final Object element) { for(ChooseByNameContributor c: getContributors()) { if (c instanceof GotoClassContributor) { String result = ((GotoClassContributor) c).getQualifiedName((NavigationItem) element); if (result != null) return result; } } if (element instanceof PsiElement) { final PsiElement psiElement = (PsiElement)element; final String containerText = SymbolPresentationUtil.getSymbolContainerText(psiElement); return containerText + "." + getElementName(element); } return getElementName(element); }
Example #2
Source File: ContributorsBasedGotoByModel.java From consulo with Apache License 2.0 | 6 votes |
public void processContributorNames(@Nonnull ChooseByNameContributor contributor, @Nonnull FindSymbolParameters parameters, @Nonnull Processor<? super String> nameProcessor) { TIntHashSet filter = new TIntHashSet(1000); if (contributor instanceof ChooseByNameContributorEx) { ((ChooseByNameContributorEx)contributor).processNames(s -> { if (nameProcessor.process(s)) { filter.add(s.hashCode()); } return true; }, parameters.getSearchScope(), parameters.getIdFilter()); } else { String[] names = contributor.getNames(myProject, parameters.isSearchInLibraries()); for (String element : names) { if (nameProcessor.process(element)) { filter.add(element.hashCode()); } } } myContributorToItsSymbolsMap.put(contributor, filter); }
Example #3
Source File: SymfonySymbolSearchAction.java From idea-php-symfony2-plugin with MIT License | 5 votes |
@Override protected void gotoActionPerformed(AnActionEvent paramAnActionEvent) { FeatureUsageTracker.getInstance().triggerFeatureUsed("navigation.popup.file"); Project localProject = paramAnActionEvent.getData(CommonDataKeys.PROJECT); if (localProject != null) { SymfonySymbolSearchModel searchModel = new SymfonySymbolSearchModel(localProject, new ChooseByNameContributor[] { new Symfony2NavigationContributor(localProject) }); showNavigationPopup(paramAnActionEvent, searchModel, new MyGotoCallback(), null, true); } }
Example #4
Source File: GotoClassModel2.java From consulo with Apache License 2.0 | 5 votes |
public static String[] getSeparatorsFromContributors(List<ChooseByNameContributor> contributors) { final Set<String> separators = new HashSet<>(); separators.add("."); for(ChooseByNameContributor c: contributors) { if (c instanceof GotoClassContributor) { ContainerUtil.addIfNotNull(separators, ((GotoClassContributor)c).getQualifiedNameSeparator()); } } return separators.toArray(new String[separators.size()]); }
Example #5
Source File: ThriftPsiUtil.java From intellij-thrift with Apache License 2.0 | 5 votes |
public static void processImplementations(ThriftDefinitionName definitionName, @NotNull Processor<NavigatablePsiElement> processor) { String name = definitionName.getText(); for (ChooseByNameContributor contributor : ChooseByNameRegistry.getInstance().getClassModelContributors()) { if (!(contributor instanceof ThriftClassContributor)) { for (NavigationItem navigationItem : contributor.getItemsByName(name, name, definitionName.getProject(), false)) { if (navigationItem instanceof NavigatablePsiElement && !processor.process((NavigatablePsiElement)navigationItem)) { return; } } } } }
Example #6
Source File: GotoClassModel2.java From consulo with Apache License 2.0 | 5 votes |
@Override public String getFullName(final Object element) { if (element instanceof PsiElement && !((PsiElement)element).isValid()) { return null; } for (ChooseByNameContributor c : getContributors()) { if (c instanceof GotoClassContributor) { String result = ((GotoClassContributor)c).getQualifiedName((NavigationItem)element); if (result != null) return result; } } return getElementName(element); }
Example #7
Source File: GotoFileItemProvider.java From consulo with Apache License 2.0 | 5 votes |
/** * Invoke contributors directly, as multi-threading isn't of much value in Goto File, * and filling {@link ContributorsBasedGotoByModel#myContributorToItsSymbolsMap} is expensive for the default contributor. */ private void processNames(@Nonnull FindSymbolParameters parameters, @Nonnull Processor<? super String> nameProcessor) { List<ChooseByNameContributor> contributors = DumbService.getDumbAwareExtensions(myProject, ChooseByNameContributor.FILE_EP_NAME); for (ChooseByNameContributor contributor : contributors) { if (contributor instanceof DefaultFileNavigationContributor) { FilenameIndex.processAllFileNames(nameProcessor, parameters.getSearchScope(), // todo why it was true? parameters.getIdFilter()); } else { myModel.processContributorNames(contributor, parameters, nameProcessor); } } }
Example #8
Source File: ContributorsBasedGotoByModel.java From consulo with Apache License 2.0 | 5 votes |
private List<ChooseByNameContributor> filterDumb(List<ChooseByNameContributor> contributors) { if (!DumbService.getInstance(myProject).isDumb()) return contributors; List<ChooseByNameContributor> answer = new ArrayList<>(contributors.size()); for (ChooseByNameContributor contributor : contributors) { if (DumbService.isDumbAware(contributor)) { answer.add(contributor); } } return answer; }
Example #9
Source File: GotoBaseAction.java From CppTools with Apache License 2.0 | 4 votes |
public MyContributorsBasedGotoByModel(Project project, CppSymbolContributor constantContributor) { super(project, new ChooseByNameContributor[]{constantContributor}); }
Example #10
Source File: SearchStringModel.java From android-strings-search-plugin with Apache License 2.0 | 4 votes |
public SearchStringModel(@NotNull Project project) { super(project, Extensions.getExtensions(ChooseByNameContributor.SYMBOL_EP_NAME)); }
Example #11
Source File: GotoFileModel.java From consulo with Apache License 2.0 | 4 votes |
public GotoFileModel(@Nonnull Project project) { super(project, ChooseByNameContributor.FILE_EP_NAME.getExtensionList()); myMaxSize = ApplicationManager.getApplication().isUnitTestMode() ? Integer.MAX_VALUE : WindowManagerEx.getInstanceEx().getFrame(project).getSize().width; }
Example #12
Source File: GotoClassModel2.java From consulo with Apache License 2.0 | 4 votes |
public GotoClassModel2(@Nonnull Project project) { super(project, ChooseByNameContributor.CLASS_EP_NAME.getExtensionList()); }
Example #13
Source File: GotoSymbolModel2.java From consulo with Apache License 2.0 | 4 votes |
public GotoSymbolModel2(@Nonnull Project project) { super(project, ChooseByNameContributor.SYMBOL_EP_NAME.getExtensionList()); }
Example #14
Source File: FilteringGotoByModel.java From consulo with Apache License 2.0 | 4 votes |
protected FilteringGotoByModel(@Nonnull Project project, @Nonnull List<ChooseByNameContributor> contributors) { super(project, contributors); }
Example #15
Source File: FilteringGotoByModel.java From consulo with Apache License 2.0 | 4 votes |
protected FilteringGotoByModel(@Nonnull Project project, @Nonnull ChooseByNameContributor[] contributors) { super(project, contributors); }
Example #16
Source File: ContributorsBasedGotoByModel.java From consulo with Apache License 2.0 | 4 votes |
protected ChooseByNameContributor[] getContributors() { return getContributorList().toArray(new ChooseByNameContributor[0]); }
Example #17
Source File: ContributorsBasedGotoByModel.java From consulo with Apache License 2.0 | 4 votes |
protected List<ChooseByNameContributor> getContributorList() { return myContributors; }
Example #18
Source File: ContributorsBasedGotoByModel.java From consulo with Apache License 2.0 | 4 votes |
protected ContributorsBasedGotoByModel(@Nonnull Project project, @Nonnull List<ChooseByNameContributor> contributors) { myProject = project; myContributors = contributors; assert !contributors.contains(null); }
Example #19
Source File: ContributorsBasedGotoByModel.java From consulo with Apache License 2.0 | 4 votes |
protected ContributorsBasedGotoByModel(@Nonnull Project project, @Nonnull ChooseByNameContributor[] contributors) { this(project, Arrays.asList(contributors)); }
Example #20
Source File: GotoClassAction.java From consulo with Apache License 2.0 | 4 votes |
@Override protected boolean hasContributors(DataContext dataContext) { return ChooseByNameContributor.CLASS_EP_NAME.hasAnyExtensions(); }
Example #21
Source File: GotoSymbolAction.java From consulo with Apache License 2.0 | 4 votes |
@Override protected boolean hasContributors(DataContext dataContext) { return ChooseByNameContributor.SYMBOL_EP_NAME.hasAnyExtensions(); }
Example #22
Source File: ChooseTargetModel.java From buck with Apache License 2.0 | 4 votes |
public ChooseTargetModel(Project project) { super(project, new ChooseByNameContributor[] {new ChooseTargetContributor()}); }
Example #23
Source File: SymfonySymbolSearchModel.java From idea-php-symfony2-plugin with MIT License | 4 votes |
public SymfonySymbolSearchModel(@NotNull Project project, @NotNull ChooseByNameContributor[] contributors) { super(project, contributors); }
Example #24
Source File: ChooseTargetModel.java From Buck-IntelliJ-Plugin with Apache License 2.0 | 4 votes |
public ChooseTargetModel(Project project) { super(project, new ChooseByNameContributor[] { new ChooseTargetContributor() }); }