Package docking.widgets.search
Class TextComponentSearchResults
java.lang.Object
docking.widgets.search.SearchResults
docking.widgets.search.TextComponentSearchResults
-
Nested Class Summary
Nested classes/interfaces inherited from class docking.widgets.search.SearchResults
SearchResults.ActivationJob, SearchResults.FindJob, SearchResults.SwingJob -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTextComponentSearchResults(Worker worker, JEditorPane editorPane, String searchText, TreeMap<Integer, TextComponentSearchLocation> matchesByPosition) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Triggers the potentially asynchronous activation of this set of search results.protected SearchResults.ActivationJobStarts the job that will activate this class.protected SearchResults.ActivationJobvoidDeactivates this set of search results.voiddispose()Returns the active search location or null. The active location is typically the search location that contains the user's cursor..Returns all search locations in this set of search resultsgetName()Returns the name of this set of search results.booleanisEmpty()protected booleanvoidsetActiveLocation(SearchLocation location) Sets the active location, which will be highlighted differently than the other search matches.protected SearchResults.ActivationJobCreate a job to perform activation for this class.toString()Methods inherited from class docking.widgets.search.SearchResults
cancelAllJobsOfType, getFilename, runActivationJob, runJob
-
Field Details
-
editorPane
-
-
Constructor Details
-
TextComponentSearchResults
protected TextComponentSearchResults(Worker worker, JEditorPane editorPane, String searchText, TreeMap<Integer, TextComponentSearchLocation> matchesByPosition)
-
-
Method Details
-
getName
Description copied from class:SearchResultsReturns 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.- Specified by:
getNamein classSearchResults- Returns:
- the name or null
-
deactivate
public void deactivate()Description copied from class:SearchResultsDeactivates this set of search results. This will clear this results' highlights from the source of the search.- Specified by:
deactivatein classSearchResults
-
activate
public void activate()Triggers the potentially asynchronous activation of this set of search results. When that is finished, we then restore our highlights. This is needed in the case that the implementor is using a document that does not match our search results. Some subclasses use asynchronous loading of their document.- Specified by:
activatein classSearchResults
-
setActiveLocation
Description copied from class:SearchResultsSets the active location, which will be highlighted differently than the other search matches. This method will ensure that this search results object is active (seeSearchResults.activate(). This method will also move the cursor to the given location.- Specified by:
setActiveLocationin classSearchResults- Parameters:
location- the location
-
startActivation
Create a job to perform activation for this class. The activation job may be a 'done' job if not activation is required.- Returns:
- the job
-
createActivationJob
Starts the job that will activate this class. Subclasses can override this method to change the job that gets run.- Returns:
- the job
-
createFinishedActivationJob
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin classSearchResults
-
getLocations
Description copied from class:SearchResultsReturns all search locations in this set of search results- Specified by:
getLocationsin classSearchResults- Returns:
- the location
-
isInvalid
-
getActiveLocation
Description copied from class:SearchResultsReturns the active search location or null. The active location is typically the search location that contains the user's cursor..- Specified by:
getActiveLocationin classSearchResults- Returns:
- the active search location or null. The active location is typically the search location that contains the user's cursor.
-
dispose
public void dispose()- Specified by:
disposein classSearchResults
-
toString
-