public class DefaultChooseByNameItemProvider extends java.lang.Object implements ChooseByNameInScopeItemProvider
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultChooseByNameItemProvider.PathProximityComparator |
| Constructor and Description |
|---|
DefaultChooseByNameItemProvider(PsiElement context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
filterElements(ChooseByNameBase base,
FindSymbolParameters parameters,
ProgressIndicator indicator,
Processor<java.lang.Object> consumer)
Searches for elements that match specified filters.
|
boolean |
filterElements(ChooseByNameBase base,
java.lang.String pattern,
boolean everywhere,
ProgressIndicator indicator,
Processor<java.lang.Object> consumer) |
static boolean |
filterElements(ChooseByNameViewModel base,
java.lang.String pattern,
boolean everywhere,
ProgressIndicator indicator,
PsiElement context,
Processor<java.lang.Object> consumer)
Filters and sorts elements in the given choose by name popup according to the given pattern.
|
boolean |
filterElementsWithWeights(ChooseByNameBase base,
FindSymbolParameters parameters,
ProgressIndicator indicator,
Processor<? super FoundItemDescriptor<?>> consumer)
Searches for elements that match specified filters and returns also their weights.
|
boolean |
filterElementsWithWeights(ChooseByNameBase base,
java.lang.String pattern,
boolean everywhere,
ProgressIndicator indicator,
Processor<? super FoundItemDescriptor<?>> consumer)
Searches for elements that match specified filters and returns also their weights.
|
java.util.List<java.lang.String> |
filterNames(ChooseByNameBase base,
java.lang.String [] names,
java.lang.String pattern) |
protected DefaultChooseByNameItemProvider.PathProximityComparator |
getPathProximityComparator() |
protected static MatchResult |
matches(ChooseByNameViewModel base,
java.lang.String pattern,
MinusculeMatcher matcher,
java.lang.String name) |
public DefaultChooseByNameItemProvider(PsiElement context)
public boolean filterElements(ChooseByNameBase base, java.lang.String pattern, boolean everywhere, ProgressIndicator indicator, Processor<java.lang.Object> consumer)
filterElements in interface ChooseByNameItemProviderpublic boolean filterElements(ChooseByNameBase base, FindSymbolParameters parameters, ProgressIndicator indicator, Processor<java.lang.Object> consumer)
ChooseByNameInScopeItemProviderFindSymbolParameters)filterElements in interface ChooseByNameInScopeItemProviderparameters - search parametersindicator - ProgressIndicator which could be used to cancel search processconsumer - consumer for process all found itemstrue if all found items were processed. If consumer returns false for any of them
search will be stopped and method will return falseFindSymbolParameterspublic boolean filterElementsWithWeights(ChooseByNameBase base, java.lang.String pattern, boolean everywhere, ProgressIndicator indicator, Processor<? super FoundItemDescriptor<?>> consumer)
ChooseByNameWeightedItemProviderFoundItemDescriptor wrapper that contains found item and its weight.
Method should be used when receiver wants to sort found items by itself (for example when they should be mixed with results from other providers)filterElementsWithWeights in interface ChooseByNameWeightedItemProviderpattern - string pattern for searcheverywhere - indicates if search should be preformed only in project files or external resources (like libraries and other) should be includedindicator - ProgressIndicator which could be used to cancel search processconsumer - consumer for process all found items. Takes instances of FoundItemDescriptor wrapper,
which contains also item's wightstrue if all found items were processed. If consumer returns false for any of them search will be
stopped and method will return falseFoundItemDescriptorpublic boolean filterElementsWithWeights(ChooseByNameBase base, FindSymbolParameters parameters, ProgressIndicator indicator, Processor<? super FoundItemDescriptor<?>> consumer)
ChooseByNameInScopeItemProviderFindSymbolParameters)
Method should be used when receiver wants to sort found items by itself (for example when they should be mixed with results from other providers)filterElementsWithWeights in interface ChooseByNameInScopeItemProviderparameters - search parametersindicator - ProgressIndicator which could be used to cancel search processconsumer - consumer for process all found items. Takes instances of FoundItemDescriptor wrapper, which contains also
item's wightstrue if all found items were processed. If consumer returns false for any of them search will be
stopped and method will return falseFindSymbolParameters,
FoundItemDescriptorpublic static boolean filterElements(ChooseByNameViewModel base, java.lang.String pattern, boolean everywhere, ProgressIndicator indicator, PsiElement context, Processor<java.lang.Object> consumer)
indicator - Progress indicator which can be used to cancel the operationcontext - The PSI element currently open in the editor (used for proximity ordering of returned results)consumer - The consumer to which the results (normally NavigationItem instances) are passedprotected DefaultChooseByNameItemProvider.PathProximityComparator getPathProximityComparator()
public java.util.List<java.lang.String> filterNames(ChooseByNameBase base, java.lang.String [] names, java.lang.String pattern)
filterNames in interface ChooseByNameItemProviderprotected static MatchResult matches(ChooseByNameViewModel base, java.lang.String pattern, MinusculeMatcher matcher, java.lang.String name)