Class PIASimpleSearch

All Implemented Interfaces:
PClientComponent, PComponent, PViewComponent, PViewDataChangeListener, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, SwingConstants

public class PIASimpleSearch extends JButton implements PViewComponent, ActionListener, Serializable
PIASimpleSearch is a Swing-compatible, generic search button. Uses a PCollectDataEvent to collect search data. Its data is the results of the search.
Version:
$Version$
Author:
Larry Lynch-Freshner
See Also:
  • Constructor Details

    • PIASimpleSearch

      public PIASimpleSearch()
      Constructs a generic search button and adds an ActionListener to it.
    • PIASimpleSearch

      public PIASimpleSearch(String label)
      Constructs a generic search button with a label and adds an ActionListener to it.
      Parameters:
      label - the String to use for the label
  • Method Details

    • unregister

      public void unregister() throws RemoteException
      Used to disassociate this component from its delegate (controller)
      Specified by:
      unregister in interface PClientComponent
      Throws:
      RemoteException
    • setModelHandle

      public void setModelHandle(PModelHandle data) throws RemoteException
      Sets the data for the component to use.
      Specified by:
      setModelHandle in interface PComponent
      Parameters:
      data - the new flist to display from
      Throws:
      RemoteException - thrown for errors
    • getModelHandle

      public PModelHandle getModelHandle() throws RemoteException
      Gets the data for the component to use.
      Specified by:
      getModelHandle in interface PComponent
      Returns:
      The new flist to display from.
      Throws:
      RemoteException - thrown for errors
    • isLight

      public boolean isLight() throws RemoteException
      Determines whether this is a lightweight component. Lightweight components do not have their own model. Instead, they use the model of their container. This means that getModelHandle always returns null, setModelHandle is ignored, and no property change events are generated.
      Specified by:
      isLight in interface PComponent
      Returns:
      False, by default.
      Throws:
      RemoteException - thrown for errors
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Gets the class name for the controller of this class.
      Specified by:
      getControllerClassName in interface PComponent
      Returns:
      A String with the component's controller class name.
      Throws:
      RemoteException - thrown for errors
    • getTools

      public Vector getTools()
      Gets a list of actions supported by this component. When overloading this method, be sure to call the super class method, then add its actions to the returned list. This preserves actions supplied by base classes. The default Action supplied includes help for this component.
      Specified by:
      getTools in interface PClientComponent
      Returns:
      A Vector that contains Action objects.
    • setResourceName

      public void setResourceName(String name)
      Sets the base resource name used in resource look up. Basically, the resource name is this base, followed by a dot, followed by the local name (label).
      Specified by:
      setResourceName in interface PClientComponent
      Parameters:
      name - a String that contains the new base resource name
    • getResourceName

      public String getResourceName()
      Gets the base resource name used in resource look up.
      Specified by:
      getResourceName in interface PClientComponent
      Returns:
      A String with the base resource name
    • firePropertyChange

      public void firePropertyChange(String prop, Object oldV, Object newV)
      Fires a property change event. If old value and new value are not equal, fires a property change event to registered change listeners.
      Specified by:
      firePropertyChange in interface PViewComponent
      Overrides:
      firePropertyChange in class Component
      Parameters:
      prop - the property being changed
      oldV - the old value
      newV - the new value
    • fireVetoableChange

      public void fireVetoableChange(String prop, Object oldV, Object newV) throws PropertyVetoException
      Fires a vetoable property change event. If old value and new value are not equal, fires a vetoable property change event to registered vetoable change listeners.
      Specified by:
      fireVetoableChange in interface PViewComponent
      Overrides:
      fireVetoableChange in class JComponent
      Parameters:
      prop - the property being changed
      oldV - the old value
      newV - the new value
      Throws:
      PropertyVetoException - thrown if the proposed change represents an unacceptable value
    • getRemoteComponent

      public PRemoteComponent getRemoteComponent()
      Gets a reference to the remote component for this object.
      Specified by:
      getRemoteComponent in interface PViewComponent
      Returns:
      A PRemoteComponent reference to the object.
    • viewDataChange

      public void viewDataChange(PViewDataChangeEvent event) throws RemoteException
      Overrides PViewDataChangeListener. This method is no longer called by the controller itself. To ensure backward compatibility, it is called after the model is set, by any operation that causes a change in the display data. The client code should call the appropriate get() methods on the controller to get the data, as the PViewDataChangeEvent parameter is no longer used.
      Specified by:
      viewDataChange in interface PViewDataChangeListener
      Parameters:
      event - the PViewDataChangeEvent event that describes the change. No longer used. By default, the value passed in is always set to null.
      Throws:
      RemoteException - thrown for errors
    • addCollectDataListener

      public void addCollectDataListener(PCollectDataListener l)
      Adds a collect data event listener.
      Parameters:
      l - the new collect data event listener to add
    • removeCollectDataListener

      public void removeCollectDataListener(PCollectDataListener l)
      Removes a collect data event listener from the list.
      Parameters:
      l - the collect data event listener to remove
    • setStorableClass

      public void setStorableClass(String sclass) throws RemoteException
      Sets the class used by the component for searches.
      Parameters:
      class - the storable class name to search for
      Throws:
      RemoteException - thrown for errors
    • getStorableClass

      public String getStorableClass() throws RemoteException
      Gets the storable class searched for by this component.
      Returns:
      The storable class used.
      Throws:
      RemoteException - thrown for errors
    • actionPerformed

      public void actionPerformed(ActionEvent evt)
      Invoked when a search Action occurs.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      evt - the search ActionEvent
    • collectData

      protected Vector collectData() throws RemoteException
      Throws:
      RemoteException