Class ScriptSearchManager
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.scripteditor.ScriptSearchManager
-
- All Implemented Interfaces:
SearchProvider
public class ScriptSearchManager extends java.lang.Object implements SearchProvider
This special implementation of SearchProvider collects together sub-providers and displays them as selectable categories. It would be nice to not have to do this as a singleton, and to have API level support for sub-providers, but for now this works.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.designer.findreplace.SearchProvider
SearchProvider.SelectedObjectsHandler
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Object>
getCategories()
Returns a list of "categories", or sub-selectable units, supported by this search provider.static ScriptSearchManager
getInstance()
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 resourcesvoid
registerSubProvider(SearchProvider provider)
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.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.void
unregisterSubProvider(java.lang.String providerName)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.designer.findreplace.SearchProvider
getExecutor
-
-
-
-
Method Detail
-
getInstance
public static ScriptSearchManager getInstance()
-
registerSubProvider
public void registerSubProvider(SearchProvider provider)
-
unregisterSubProvider
public void unregisterSubProvider(java.lang.String providerName)
-
getName
public java.lang.String getName()
Description copied from interface:SearchProvider
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.- Specified by:
getName
in interfaceSearchProvider
-
getCategories
public java.util.List<java.lang.Object> getCategories()
Description copied from interface:SearchProvider
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.- Specified by:
getCategories
in interfaceSearchProvider
-
hasSelectableObjects
public boolean hasSelectableObjects()
Description copied from interface:SearchProvider
Whether or not the set of objects searched by this provider is selectable- for examples, which groups or windows are to be searched.- Specified by:
hasSelectableObjects
in interfaceSearchProvider
-
selectedObjectsToString
public java.lang.String selectedObjectsToString(java.util.List<java.lang.Object> objects)
Description copied from interface:SearchProvider
Formats the list of selected objects as a brief string.- Specified by:
selectedObjectsToString
in interfaceSearchProvider
-
selectObjects
public void selectObjects(SearchProvider.SelectedObjectsHandler handler)
Description copied from interface:SearchProvider
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.- Specified by:
selectObjects
in interfaceSearchProvider
-
retrieveSearchableObjects
public java.util.Iterator<SearchObject> retrieveSearchableObjects(java.util.Collection<java.lang.Object> categories, java.util.List<java.lang.Object> searchObjects, TaskProgressListener progress)
Description copied from interface:SearchProvider
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.
- Specified by:
retrieveSearchableObjects
in interfaceSearchProvider
- 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
public void notifySearchClosed()
Description copied from interface:SearchProvider
Called when the search dialog box is closed, so that the search provider can release any cached resources- Specified by:
notifySearchClosed
in interfaceSearchProvider
-
-