Class PDeviceSearchBasePanel

All Implemented Interfaces:
PSpreadSheetListener, PIASelectionListener, ActionListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class PDeviceSearchBasePanel extends JPanel implements ActionListener, PropertyChangeListener, PSpreadSheetListener, PIASelectionListener
This is the base search panel for devices.
This panel contains four parts:
  • Search entry panel
  • Search entry command buttons panel
  • Search results panel
  • Search results command buttons panel
See Also:
  • Field Details

    • SEARCH_COMMAND_RESET

      public static final String SEARCH_COMMAND_RESET
      search Reset command.
      See Also:
    • SEARCH_COMMAND_HELP

      public static final String SEARCH_COMMAND_HELP
      search help command.
      See Also:
    • SEARCH_COMMAND_OPEN

      public static final String SEARCH_COMMAND_OPEN
      search Open command.
      See Also:
    • SEARCH_COMMAND_CANCEL

      public static final String SEARCH_COMMAND_CANCEL
      search Cancel command.
      See Also:
    • SEARCH_ENTRY_STATUS_PROPERTY

      public static final String SEARCH_ENTRY_STATUS_PROPERTY
      The property name for listening to search entry status change. This value is hard-coded in PIASearchPanel.
      See Also:
    • SEARCH_RESULT_STATUS_PROPERTY

      public static final String SEARCH_RESULT_STATUS_PROPERTY
      The property name for listening to search result status change. This value is hard-coded in PIASpecSpreadSheet.
      See Also:
    • ENTRY_PANEL_CLASS_SUFFIX

      public static final String ENTRY_PANEL_CLASS_SUFFIX
      suffix of the device search entry panel class key
      See Also:
    • RESULTS_PANEL_CLASS_SUFFIX

      public static final String RESULTS_PANEL_CLASS_SUFFIX
      suffix of the device search results panel class key
      See Also:
    • mEntryPanel

      protected PSearchProducer mEntryPanel
    • mResultsPanel

      protected PSearchConsumer mResultsPanel
  • Constructor Details

    • PDeviceSearchBasePanel

      public PDeviceSearchBasePanel(String deviceClass)
      Creates a base device search panel.
      Parameters:
      deviceClass - device storable class name
  • Method Details

    • selectionChanged

      public void selectionChanged(PSpreadSheetEvent event)
      Double-clicking on the results table with a row selected will trigger the "Open" command.
      Specified by:
      selectionChanged in interface PSpreadSheetListener
      Parameters:
      event - the event.
    • selectionChanged

      public void selectionChanged(PIASelectionEvent event)
      Description copied from interface: PIASelectionListener
      Handles a selection event.
      Specified by:
      selectionChanged in interface PIASelectionListener
      Parameters:
      event - the event to handle
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Action handler for all buttons.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - the event.
    • propertyChange

      public void propertyChange(PropertyChangeEvent event)
      Called when the search is conducted. We update the search status accordingly.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e - the event.
    • addResultsListener

      public void addResultsListener(ActionListener listener)
      Registers to listen to results events.
      Parameters:
      listener - the results event listener to add
    • removeResultsListener

      public void removeResultsListener(ActionListener listener)
      Removes the given listener from results events.
      Parameters:
      listener - the results event listener to remove
    • getSelectedDevice

      public PModelHandle getSelectedDevice()
      Retrieves currently selected device.
      Returns:
      currently selected device model handle
    • enableControls

      protected void enableControls(boolean isSearching)
    • setStatus

      protected void setStatus(String newStatus)
    • setStatusIcon

      protected void setStatusIcon(Icon statusIcon)
    • createMainPanel

      protected JPanel createMainPanel()
    • createEntryButtonsPanel

      protected JPanel createEntryButtonsPanel()
    • createResultsButtonsPanel

      protected JPanel createResultsButtonsPanel()