Class ColumnSearchWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
DataColumnSearchWindow, SmallColumnSearchWindow

public class ColumnSearchWindow extends AuxDialog
Dialog window that allows the user to search for text content in cells of a column of a displayed table.

This is a partial implementation that provides the basic GUI, but it must be extended to do something useful such as actually perform a search and message a user with the results.

It could quite easily be generalised to search for text in something that isn't a table column.

Since:
14 Sep 2023
Author:
Mark Taylor
See Also:
  • Constructor Details

    • ColumnSearchWindow

      public ColumnSearchWindow(String title, Window owner, String colselLabel, ComboBoxModel<TableColumn> colSelectorModel)
      Constructor. Does not pack components.
      Parameters:
      title - title of dialogue window
      owner - window that owns this dialogue
      colselLabel - label for selector of the column to use
      colSelectorModel - model for selector of the column to use
  • Method Details

    • getActionForwarder

      public ActionForwarder getActionForwarder()
      Returns the action forwarder used by the components in this GUI.
      Returns:
      action forwarder
    • getControlBox

      public JComponent getControlBox()
      Returns a container into which control buttons may be put.
      Returns:
      control box
    • getTextField

      public JTextField getTextField()
      Returns the text component into which the user enters search terms.
      Returns:
      search field
    • getColumnSelector

      public JComboBox<TableColumn> getColumnSelector()
      Returns the component used for selecting columns to search.
      Returns:
      column selector
    • searchCompleted

      public void searchCompleted(boolean success)
      Should be called when a search is completed. Must be called from the Event Dispatch Thread.

      At present, the behaviour is to dispose this dialogue if the search was successful, unless the GUI has been configured otherwise.

      Parameters:
      success - true iff the search was successful (terms found)
    • setColumn

      public void setColumn(TableColumn tcol)
      Programmatically configures the column to be searched by this window.
      Parameters:
      tcol - column
    • createSearch

      public ColumnSearchWindow.Search createSearch()
      Creates a search specification based on the current configuration of this window's input components.
      Returns:
      search object if the GUI is configured to provide one, null if it is not