com.intellij.navigation.ChooseByNameContributorEx Java Examples

The following examples show how to use com.intellij.navigation.ChooseByNameContributorEx. 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: ContributorsBasedGotoByModel.java    From consulo with Apache License 2.0 6 votes vote down vote up
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);
}