Class AbstractScriptSearchProvider<T>
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.findreplace.AbstractSearchProvider
-
- com.inductiveautomation.ignition.designer.scripteditor.AbstractScriptSearchProvider<T>
-
- All Implemented Interfaces:
SearchProvider
- Direct Known Subclasses:
ScriptConfigSearchProvider
,ScriptLibrarySearchProvider
public abstract class AbstractScriptSearchProvider<T> extends AbstractSearchProvider
This provider can be instantiated and added multiple times for different script scopes. Inheriting classes will want to override retrieveSearchableObjects and use Iterators.concat() to zipper additional results in.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractScriptSearchProvider.AbstractScriptSearchObject
protected class
AbstractScriptSearchProvider.MapIterator<K>
protected class
AbstractScriptSearchProvider.SimplePropertySO
-
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.designer.findreplace.SearchProvider
SearchProvider.SelectedObjectsHandler
-
-
Constructor Summary
Constructors Constructor Description AbstractScriptSearchProvider(DesignerContext context, java.lang.String name, ResourceType resourceType, java.lang.Runnable locateFunc)
-
Method Summary
All 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.protected DesignerContext
getContext()
protected org.apache.log4j.Logger
getLogger()
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.java.lang.String
getSelectableObjectBaseKey()
Returns a key that will be used withBundleUtil
to get various descriptions of the selectable objects.protected T
getTargetObject()
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.protected void
loadTargetObject()
protected void
saveResource()
void
selectObjects(SearchProvider.SelectedObjectsHandler handler)
Instructs the SearchProvider to show a dialog in order to select the objects to search.protected byte[]
serialize(java.lang.Object resource)
protected void
showEditorWindow()
-
Methods inherited from class com.inductiveautomation.ignition.designer.findreplace.AbstractSearchProvider
notifySearchClosed, selectedObjectsToString, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.designer.findreplace.SearchProvider
getExecutor, retrieveSearchableObjects
-
-
-
-
Constructor Detail
-
AbstractScriptSearchProvider
public AbstractScriptSearchProvider(DesignerContext context, java.lang.String name, ResourceType resourceType, java.lang.Runnable locateFunc)
-
-
Method Detail
-
getContext
protected DesignerContext getContext()
-
getLogger
protected org.apache.log4j.Logger getLogger()
-
getTargetObject
protected T getTargetObject()
-
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.
-
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.
-
getSelectableObjectBaseKey
public java.lang.String getSelectableObjectBaseKey()
Description copied from class:AbstractSearchProvider
Returns a key that will be used withBundleUtil
to get various descriptions of the selectable objects. It is expected that the following keys exist:
'{Key}.One' - "%d object"
'{Key}.Many' - "%d objects"
'{Key}.Default' - what will be searched if no objects are selected. For example, "All groups" or "Default provider"- Specified by:
getSelectableObjectBaseKey
in classAbstractSearchProvider
- Returns:
- a
BundleUtil
key corresponding to a description for a selectable object.
-
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.
-
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.
-
loadTargetObject
protected void loadTargetObject()
-
saveResource
protected void saveResource()
-
serialize
protected byte[] serialize(java.lang.Object resource) throws SerializationException
- Throws:
SerializationException
-
showEditorWindow
protected void showEditorWindow()
-
-