Package org.omegat.gui.search
Class SearchWindowController
java.lang.Object
org.omegat.gui.search.SearchWindowController
This is a window that appears when a user wants to search for something.
For each new user's request a new window is created. Actual search is done by
SearchThread.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWindowListener(WindowListener listener) voiddisplayErrorRB(Throwable ex, String errorKey, Object... params) Display message dialog with the error as messagevoiddisplaySearchResult(Searcher searcher) Show search result for uservoiddispose()voidFocus the search field and select the current query textgetMode()Get the currently selected text in the search results paneGet the search window framevoidinsertIntoActiveField(String text) Insert the specified text into the currently active (focused) search field: either Search or ReplacevoidmakeVisible(String query) Make Search window visible on screen, with optional initial query (may be null).voidReplace the text of the currently active (focused) search field: either Search or ReplacevoidReset search options to their default values.voidsetSearchText(String text) Set the content of the search query
-
Constructor Details
-
SearchWindowController
-
-
Method Details
-
getMode
-
resetOptions
public void resetOptions()Reset search options to their default values. Search terms are left unchanged, as are any settings that don't affect the search results (such as syncing with editor). -
displaySearchResult
Show search result for user -
dispose
public void dispose() -
makeVisible
Make Search window visible on screen, with optional initial query (may be null).- Parameters:
query- Initial query string (may be empty or null)
-
getViewerSelection
Get the currently selected text in the search results pane- Returns:
- Selected text, or
nullif none
-
setSearchText
Set the content of the search query- Parameters:
text- The query text
-
focusSearchField
public void focusSearchField()Focus the search field and select the current query text -
insertIntoActiveField
Insert the specified text into the currently active (focused) search field: either Search or Replace- Parameters:
text- The text to insert
-
replaceCurrentFieldText
Replace the text of the currently active (focused) search field: either Search or Replace- Parameters:
text- The text to set
-
getWindow
Get the search window frame- Returns:
- search window frame
-
addWindowListener
-
displayErrorRB
Display message dialog with the error as message- Parameters:
ex- exception to showerrorKey- error message key in resource bundleparams- error text parameters
-