Class SearchWindowController

java.lang.Object
org.omegat.gui.search.SearchWindowController

public class SearchWindowController extends Object
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 Details

    • SearchWindowController

      public SearchWindowController(SearchMode mode)
  • Method Details

    • 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(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 String getViewerSelection()
      Get the currently selected text in the search results pane
      Returns:
      Selected text, or null if none
    • setSearchText

      public void setSearchText(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(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(String text)
      Replace the text of the currently active (focused) search field: either Search or Replace
      Parameters:
      text - The text to set
    • getWindow

      public JFrame getWindow()
      Get the search window frame
      Returns:
      search window frame
    • addWindowListener

      public void addWindowListener(WindowListener listener)
    • displayErrorRB

      public void displayErrorRB(Throwable ex, String errorKey, Object... params)
      Display message dialog with the error as message
      Parameters:
      ex - exception to show
      errorKey - error message key in resource bundle
      params - error text parameters