Package docking.widgets.search
Class SearchResults
java.lang.Object
docking.widgets.search.SearchResults
- Direct Known Subclasses:
TextComponentSearchResults
A collection of
SearchLocations created when the user has performed a find operation on
the FindDialog. The dialog will find all results and then use the results to move to the
next and previous locations as requested. The user may also choose to show all results in a
table.
The searcher uses a worker queue to manage activating and deactivating highlights, which may require reload operations on the originally searched text.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassprotected classA workerJobthat allows subclasses to add follow-on jobs to be performed as long as the work is not cancelled.class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidactivate()Activates this set of search results.protected voidClears all jobs that have the same class as the given job.abstract voidDeactivates this set of search results.abstract voiddispose()abstract SearchLocationReturns the active search location or null. The active location is typically the search location that contains the user's cursor..protected StringgetFilename(URL url) abstract List<SearchLocation> Returns all search locations in this set of search resultsabstract StringgetName()Returns the name of this set of search results.abstract booleanisEmpty()protected voidRuns the given activation job.protected voidSchedules the given job to run.abstract voidsetActiveLocation(SearchLocation location) Sets the active location, which will be highlighted differently than the other search matches.
-
Constructor Details
-
SearchResults
-
-
Method Details
-
getName
Returns the name of this set of search results. This is a short description, such as a filename or function name. This should be null for text components that do not change contents based on some external source of data, such as a file.- Returns:
- the name or null
-
activate
public abstract void activate()Activates this set of search results. This will restore highlights to the source of the search. -
deactivate
public abstract void deactivate()Deactivates this set of search results. This will clear this results' highlights from the source of the search. -
setActiveLocation
Sets the active location, which will be highlighted differently than the other search matches. This method will ensure that this search results object is active (seeactivate(). This method will also move the cursor to the given location.- Parameters:
location- the location
-
getActiveLocation
Returns the active search location or null. The active location is typically the search location that contains the user's cursor..- Returns:
- the active search location or null. The active location is typically the search location that contains the user's cursor.
-
getLocations
Returns all search locations in this set of search results- Returns:
- the location
-
isEmpty
public abstract boolean isEmpty() -
dispose
public abstract void dispose() -
getFilename
-
cancelAllJobsOfType
Clears all jobs that have the same class as the given job. Clients can call this method before submitting the given job to clear any other instances of that job type before running.- Parameters:
job- the job
-
runActivationJob
Runs the given activation job. This class will cancel any existing activation jobs with the assumption that only one activation should be taking place at any given time. This is useful since activations may be slow.- Parameters:
job- the job
-
runJob
Schedules the given job to run. This does not cancel any other pending work.- Parameters:
job- the job
-