public interface SearchInfo
DataObject
s should be searched.
Iterator returned by this interface's method enumerates
DataObject
s that should be searched.
SearchInfo
objects are used by module User Utilities
– in actions Find (since User Utilities 1.16)
and Find in Projects (since User Utilities 1.23).
Action Find obtains SearchInfo
from
Lookup
of nodes
the action was invoked on. Action Find in Projects obtains
SearchInfo
from
Lookup
of the projects.
Recommendation: Use SearchInfo.Files
instead of this interface.
See SearchInfo.objectsToSearch()
and SearchInfo.Files.filesToSearch()
.
SearchInfoFactory
,
DataObject
,
Node.getLookup()
,
Project.getLookup()
Modifier and Type | Interface and Description |
---|---|
static interface |
SearchInfo.Files
Additionally defines which
FileObject s should be searched. |
Modifier and Type | Method and Description |
---|---|
boolean |
canSearch()
Determines whether the object which provided this
SearchInfo
can be searched. |
Iterator<DataObject> |
objectsToSearch()
Specifies which
DataObject s should be searched. |
boolean canSearch()
SearchInfo
can be searched.
This method determines whether the Find action should be enabled
for the object or not.
This method must be very quick as it may be called frequently and its
speed may influence responsiveness of the whole application. If the exact
algorithm for determination of the result value should be slow, it is
better to return true
than make the method slow.
false
if the object is known that it cannot be
searched; true
otherwiseIterator<DataObject> objectsToSearch()
DataObject
s should be searched.
The returned Iterator
needn't implement method
remove()
(i.e. it may throw
UnsupportedOperationException
instead of actual
implementation).
Recommendation: Use interface SearchInfo.Files
and its method
SearchInfo.Files.filesToSearch()
. It avoids unnecessary creation of
DataObject
s, so searching works faster
and consumes less memory.
DataObject
s
to be searched