Interface SearchProvider
-
- All Known Implementing Classes:
AbstractScriptSearchProvider
,AbstractSearchProvider
,ClientScriptSearchProvider
,ModuleLibrarySearchProvider
,NamedQuerySearchProvider
,PipelineSearchProvider
,ScriptConfigSearchProvider
,ScriptLibrarySearchProvider
,ScriptSearchManager
,StylesSearchProvider
,TagSearchProvider
,ViewSearchProvider
,VisionSearchProvider
public interface SearchProvider
Defines a coarse unit of searchability. SearchProviders can have sub-categories and selectable objects that define the set of what will be searched.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SearchProvider.SelectedObjectsHandler
Passed to the search provider when the user wants to select which objects to search.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
addAsyncReplaceListener(AsyncReplaceListener listener)
Add a listener that will be notified when a replace operation that happens asynchronously has completed.java.util.List<java.lang.Object>
getCategories()
Returns a list of "categories", or sub-selectable units, supported by this search provider.default java.util.Optional<SearchExecutor>
getExecutor(SearchObjectPredicate predicate)
default java.lang.String
getId()
Returns an ID for this search provider.java.lang.String
getName()
Returns the name of the search provider, which will be used in the gateway and a UI to uniquely identify the provider.boolean
hasSelectableObjects()
Whether or not the set of objects searched by this provider is selectable- for examples, which groups or windows are to be searched.void
notifySearchClosed()
Called when the search dialog box is closed, so that the search provider can release any cached resourcesjava.util.Iterator<SearchObject>
retrieveSearchableObjects(java.util.Collection<java.lang.Object> categories, java.util.List<java.lang.Object> searchObjects, TaskProgressListener progress)
Returns an iterator that provides all of the objects described by the parameters.java.lang.String
selectedObjectsToString(java.util.List<java.lang.Object> objects)
Formats the list of selected objects as a brief string.void
selectObjects(SearchProvider.SelectedObjectsHandler handler)
Instructs the SearchProvider to show a dialog in order to select the objects to search.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of the search provider, which will be used in the gateway and a UI to uniquely identify the provider. It is expected to be in the current session's language.
-
getId
default java.lang.String getId()
Returns an ID for this search provider. Should be globally unique (e.g. a module ID) and static regardless of locale.- Since:
- 8.1.18
-
getCategories
@Nullable java.util.List<java.lang.Object> getCategories()
Returns a list of "categories", or sub-selectable units, supported by this search provider. The actual objects will be passed back in to retrieveSearchableObjects when the search is executed.
-
hasSelectableObjects
boolean hasSelectableObjects()
Whether or not the set of objects searched by this provider is selectable- for examples, which groups or windows are to be searched.
-
selectedObjectsToString
java.lang.String selectedObjectsToString(java.util.List<java.lang.Object> objects)
Formats the list of selected objects as a brief string.
-
selectObjects
void selectObjects(SearchProvider.SelectedObjectsHandler handler)
Instructs the SearchProvider to show a dialog in order to select the objects to search. The object are returned through the passed in handler, and will later be passed into executeSearch.
-
retrieveSearchableObjects
java.util.Iterator<SearchObject> retrieveSearchableObjects(java.util.Collection<java.lang.Object> categories, java.util.List<java.lang.Object> searchObjects, TaskProgressListener progress)
Returns an iterator that provides all of the objects described by the parameters. The iterator will generally stream the results, calculating the next object on each call to hasNext().The provided ProgressListener can be used to provide progress information as the Iterator is processed. Some providers may not be able to calculate progress, in which case they should call setIndeterminate(true), but the provider implementors are encouraged to provide anything they can, even if it's very coarse.
- Parameters:
categories
- indicates the user selection (if applicable) of which categories should be searched.searchObjects
- the user selected objects (if applicable) to be searched.progress
- a progress listener for this provider, which can be updated as the returned Iterator is used. If not supported, the provider should call setIndeterminate(true).
-
notifySearchClosed
void notifySearchClosed()
Called when the search dialog box is closed, so that the search provider can release any cached resources
-
getExecutor
default java.util.Optional<SearchExecutor> getExecutor(SearchObjectPredicate predicate)
-
addAsyncReplaceListener
default void addAsyncReplaceListener(AsyncReplaceListener listener)
Add a listener that will be notified when a replace operation that happens asynchronously has completed.
-
-