Class SearchPanel

All Implemented Interfaces:
PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewComponent, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class SearchPanel extends PIAPanel
Panel for doing searches. It contains two modes: one for displaying a single search template, one for displaying a group of templates in a tabbed pane for layered searching.
Version:
%version: 23 % %date_modified: Thu Feb 07 11:44:42 2002 %
Author:
mgaines
See Also:
  • Constructor Details

    • SearchPanel

      public SearchPanel()
    • SearchPanel

      public SearchPanel(Properties p)
      Constructs a search panel using a tabbed pane for selecting search templates.
      Parameters:
      p - the search template definition
    • SearchPanel

      public SearchPanel(Properties p, boolean b)
      Constructs a search panel using either a tabbed pane, which will allow the user to select from a list of templates, or a panel that displays a single template.
      Parameters:
      p - the search template definition
      b - indicates whether the panel should use a tabbed pane
    • SearchPanel

      public SearchPanel(Properties p, boolean b, String tmpl, oracle.help.CSHManager cshManager)
      Constructs a search panel using either a tabbed pane, which will allow the user to select from a list of templates, or a panel that displays a single template. The given template is then loaded in by default.
      Parameters:
      p - the search template definition
      b - indicates whether the panel should use a tabbed pane
      tmpl - the template to load in by default
      cshManager - context Sensitive help manager
    • SearchPanel

      public SearchPanel(Properties p, boolean b, String[] data, oracle.help.CSHManager cshManager)
      Constructs a search panel using either a tabbed pane, which will allow the user to select from a list of templates, or a panel that displays a single template. The given data is then loaded in by default.
      Parameters:
      p - the search template definition
      b - indicates whether the panel should use a tabbed pane
      data - the inital data to display in the window
      cshManager - context Sensitive help manager
  • Method Details

    • setCurrentTemplate

      public void setCurrentTemplate(String tmpl)
      Updates the UI with the given template. If the tabbed pane is showing, then the given panel is added to the pane, otherwise it replaces the exisiting panel.
      Parameters:
      tmpl - the template to load in the panel
    • setInitialData

      public void setInitialData(String[] data)
      Sets the initial data to be displayed in the panel.
      Parameters:
      data - any initial data to be loaded into the panel
    • setTabbedPane

      public void setTabbedPane(boolean b)
      Sets the property tabbedPane to the given value. If the value is false, than a single template will be shown. Note: this method will update the panel if possible.
      Parameters:
      b - if false, displays a single template
    • setTemplates

      public void setTemplates(Properties p)
      This method will initialize the SearchTemplates for the panel and it's controller. These templates are used to formulate searches and the controls displayed in the panel.
      Parameters:
      p - the new set of Properties to use.
    • addSearchEventListener

      public void addSearchEventListener(SearchListener l)
      Add a search listener for the search results.
      Parameters:
      l - the listener to add
    • removeSearchEventListener

      public void removeSearchEventListener(SearchListener l)
      Remove a search listener.
      Parameters:
      l - the listener to remove
    • addSearchInfoListener

      public void addSearchInfoListener(SearchInfoListener l)
      Add a SearchInfoListener. This listener will get information about the search excluding result information. As a side effect, if there are any remote listeners defined, they will be added to the remote listener list. The remote listeners will recieve information about the search results.
      Parameters:
      l - the listener to add.
    • removeSearchInfoListener

      public void removeSearchInfoListener(SearchInfoListener l)
      Removes a SearchInfoListener. As a side effect, if there are any remote listeners defined, they will be released from the remote listener list.
      Parameters:
      l - the listener to add.
    • addActionListener

      public void addActionListener(ActionListener l)
      Adds an action listener to the buttons of the dialog. The listener will be notified if one of the dialog buttons is pressed.
      Parameters:
      l - the action listener to be added
    • removeActionListener

      public void removeActionListener(ActionListener l)
      Removes the given action listener from the dialog.
      Parameters:
      l - the action listener to be removed
    • addSearchResultsListener

      public void addSearchResultsListener(ResultsListener l)
      Connects the search panel to a class that is interested in the results of the search.
      Parameters:
      l - the class interested in the search
    • removeSearchResultsListener

      public void removeSearchResultsListener(ResultsListener l)
      Disconnects the search panel to a class that is interested in the results of the search.
      Parameters:
      l - the class disinterested in the search
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Gets the class name for this panel's controller.
      Specified by:
      getControllerClassName in interface PComponent
      Overrides:
      getControllerClassName in class PIAPanel
      Returns:
      the controller's class name
      Throws:
      RemoteException - thrown for errors
    • collectData

      public void collectData(PCollectDataEvent event)
      Override collectData(), turning it into a no-op. This panel uses it's own mechanism for collecting search criteria.
      Specified by:
      collectData in interface PCollectDataListener
      Overrides:
      collectData in class PIAPanel
      Parameters:
      event - the PCollectDataEvent data event
    • viewDataChange

      public void viewDataChange(PViewDataChangeEvent event) throws RemoteException
      Listens for change events from the controller.
      Specified by:
      viewDataChange in interface PViewDataChangeListener
      Overrides:
      viewDataChange in class PIAPanel
      Parameters:
      event - the data change event
      Throws:
      RemoteException - thrown for errors
    • setResultFields

      public void setResultFields(String[] fields)
      Set the 'resultFields' property, which is used in the search. This will ensure that these fields are returned from the search results regardless of the fields that are defined in the search template.
      Parameters:
      fields - the new list of fields expected for each found result
    • fireSearchProgress

      protected void fireSearchProgress(Integer prog)
      Sends a SearchEvent which contains the progress of the search.
      Parameters:
      prog - the number of items found in the search
    • fireSearchResults

      protected void fireSearchResults(PModelHandle[] res)
      Sends a SearchEvent which contains the results of the search.
      Parameters:
      event - the search event
    • fireSearchResultData

      protected void fireSearchResultData(ResultData[] res)
      Sends a SearchEvent which contains the results of the search.
      Parameters:
      event - the search event