Package com.portal.bas.comp
Class PIASimpleSearch
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
com.portal.bas.comp.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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JButton
JButton.AccessibleJButton
Nested classes/interfaces inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a generic search button and adds anActionListener
to it.PIASimpleSearch
(String label) Constructs a generic search button with a label and adds anActionListener
to it. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when a searchAction
occurs.void
Adds a collect data event listener.protected Vector
void
firePropertyChange
(String prop, Object oldV, Object newV) Fires a property change event.void
fireVetoableChange
(String prop, Object oldV, Object newV) Fires a vetoable property change event.Gets the class name for the controller of this class.Gets the data for the component to use.Gets a reference to the remote component for this object.Gets the base resource name used in resource look up.Gets the storable class searched for by this component.getTools()
Gets a list of actions supported by this component.boolean
isLight()
Determines whether this is a lightweight component.void
Removes a collect data event listener from the list.void
setModelHandle
(PModelHandle data) Sets the data for the component to use.void
setResourceName
(String name) Sets the base resource name used in resource look up.void
setStorableClass
(String sclass) Sets the class used by the component for searches.void
Used to disassociate this component from its delegate (controller)void
OverridesPViewDataChangeListener
.Methods inherited from class javax.swing.JButton
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUI
Methods inherited from class javax.swing.AbstractButton
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
PIASimpleSearch
public PIASimpleSearch()Constructs a generic search button and adds anActionListener
to it. -
PIASimpleSearch
Constructs a generic search button with a label and adds anActionListener
to it.- Parameters:
label
- theString
to use for the label
-
-
Method Details
-
unregister
Used to disassociate this component from its delegate (controller)- Specified by:
unregister
in interfacePClientComponent
- Throws:
RemoteException
-
setModelHandle
Sets the data for the component to use.- Specified by:
setModelHandle
in interfacePComponent
- Parameters:
data
- the new flist to display from- Throws:
RemoteException
- thrown for errors
-
getModelHandle
Gets the data for the component to use.- Specified by:
getModelHandle
in interfacePComponent
- Returns:
- The new flist to display from.
- Throws:
RemoteException
- thrown for errors
-
isLight
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 thatgetModelHandle
always returns null,setModelHandle
is ignored, and no property change events are generated.- Specified by:
isLight
in interfacePComponent
- Returns:
- False, by default.
- Throws:
RemoteException
- thrown for errors
-
getControllerClassName
Gets the class name for the controller of this class.- Specified by:
getControllerClassName
in interfacePComponent
- Returns:
- A
String
with the component's controller class name. - Throws:
RemoteException
- thrown for errors
-
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 defaultAction
supplied includes help for this component.- Specified by:
getTools
in interfacePClientComponent
- Returns:
- A
Vector
that containsAction
objects.
-
setResourceName
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 interfacePClientComponent
- Parameters:
name
- aString
that contains the new base resource name
-
getResourceName
Gets the base resource name used in resource look up.- Specified by:
getResourceName
in interfacePClientComponent
- Returns:
- A
String
with the base resource name
-
firePropertyChange
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 interfacePViewComponent
- Overrides:
firePropertyChange
in classComponent
- Parameters:
prop
- the property being changedoldV
- the old valuenewV
- the new value
-
fireVetoableChange
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 interfacePViewComponent
- Overrides:
fireVetoableChange
in classJComponent
- Parameters:
prop
- the property being changedoldV
- the old valuenewV
- the new value- Throws:
PropertyVetoException
- thrown if the proposed change represents an unacceptable value
-
getRemoteComponent
Gets a reference to the remote component for this object.- Specified by:
getRemoteComponent
in interfacePViewComponent
- Returns:
- A
PRemoteComponent
reference to the object.
-
viewDataChange
OverridesPViewDataChangeListener
. 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 appropriateget
methods on the controller to get the data, as the() PViewDataChangeEvent
parameter is no longer used.- Specified by:
viewDataChange
in interfacePViewDataChangeListener
- Parameters:
event
- thePViewDataChangeEvent
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
Adds a collect data event listener.- Parameters:
l
- the new collect data event listener to add
-
removeCollectDataListener
Removes a collect data event listener from the list.- Parameters:
l
- the collect data event listener to remove
-
setStorableClass
Sets the class used by the component for searches.- Parameters:
class
- the storable class name to search for- Throws:
RemoteException
- thrown for errors
-
getStorableClass
Gets the storable class searched for by this component.- Returns:
- The storable class used.
- Throws:
RemoteException
- thrown for errors
-
actionPerformed
Invoked when a searchAction
occurs.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
evt
- the searchActionEvent
-
collectData
- Throws:
RemoteException
-