Class 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.
    • 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 message
      void displaySearchResult​(Searcher searcher)
      Show search result for user
      void dispose()  
      void focusSearchField()
      Focus the search field and select the current query text
      SearchMode getMode()  
      java.lang.String getViewerSelection()
      Get the currently selected text in the search results pane
      javax.swing.JFrame getWindow()
      Get the search window frame
      void insertIntoActiveField​(java.lang.String text)
      Insert the specified text into the currently active (focused) search field: either Search or Replace
      void 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 Replace
      void resetOptions()
      Reset search options to their default values.
      void setSearchText​(java.lang.String text)
      Set the content of the search query
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SearchWindowController

        public SearchWindowController​(SearchMode mode)
    • Method Detail

      • 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 show
        errorKey - error message key in resource bundle
        params - error text parameters