Package org.omegat.gui.search
Class SearchWindowController
- java.lang.Object
-
- org.omegat.gui.search.SearchWindowController
-
public class SearchWindowController extends java.lang.Object
This is a window that appears when user'd like to search for something. For each new user's request new window is created. Actual search is done by SearchThread.
-
-
Constructor Summary
Constructors Constructor Description SearchWindowController(SearchMode mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWindowListener(java.awt.event.WindowListener listener)
void
displayErrorRB(java.lang.Throwable ex, java.lang.String errorKey, java.lang.Object... params)
Display message dialog with the error as messagevoid
displaySearchResult(Searcher searcher)
Show search result for uservoid
dispose()
void
focusSearchField()
Focus the search field and select the current query textSearchMode
getMode()
java.lang.String
getViewerSelection()
Get the currently selected text in the search results panejavax.swing.JFrame
getWindow()
Get the search window framevoid
insertIntoActiveField(java.lang.String text)
Insert the specified text into the currently active (focused) search field: either Search or Replacevoid
makeVisible(java.lang.String query)
Make Search window visible on screen, with optional initial query (may be null).void
replaceCurrentFieldText(java.lang.String text)
Replace the text of the currently active (focused) search field: either Search or Replacevoid
resetOptions()
Reset search options to their default values.void
setSearchText(java.lang.String text)
Set the content of the search query
-
-
-
Constructor Detail
-
SearchWindowController
public SearchWindowController(SearchMode mode)
-
-
Method Detail
-
getMode
public SearchMode 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
public void displaySearchResult(Searcher searcher)
Show search result for user
-
dispose
public void dispose()
-
makeVisible
public void makeVisible(java.lang.String query)
Make Search window visible on screen, with optional initial query (may be null).- Parameters:
query
- Initial query string (may be empty or null)
-
getViewerSelection
public java.lang.String getViewerSelection()
Get the currently selected text in the search results pane- Returns:
- Selected text, or
null
if none
-
setSearchText
public void setSearchText(java.lang.String text)
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
public void insertIntoActiveField(java.lang.String text)
Insert the specified text into the currently active (focused) search field: either Search or Replace- Parameters:
text
- The text to insert
-
replaceCurrentFieldText
public void replaceCurrentFieldText(java.lang.String text)
Replace the text of the currently active (focused) search field: either Search or Replace- Parameters:
text
- The text to set
-
getWindow
public javax.swing.JFrame getWindow()
Get the search window frame- Returns:
- search window frame
-
addWindowListener
public void addWindowListener(java.awt.event.WindowListener listener)
-
displayErrorRB
public void displayErrorRB(java.lang.Throwable ex, java.lang.String errorKey, java.lang.Object... params)
Display message dialog with the error as message- Parameters:
ex
- exception to showerrorKey
- error message key in resource bundleparams
- error text parameters
-
-