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.AccessibleJButtonNested classes/interfaces inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListenerNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested 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_PROPERTYFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields 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 anActionListenerto it.PIASimpleSearch(String label) Constructs a generic search button with a label and adds anActionListenerto it. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked when a searchActionoccurs.voidAdds a collect data event listener.protected VectorvoidfirePropertyChange(String prop, Object oldV, Object newV) Fires a property change event.voidfireVetoableChange(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.booleanisLight()Determines whether this is a lightweight component.voidRemoves a collect data event listener from the list.voidsetModelHandle(PModelHandle data) Sets the data for the component to use.voidsetResourceName(String name) Sets the base resource name used in resource look up.voidsetStorableClass(String sclass) Sets the class used by the component for searches.voidUsed to disassociate this component from its delegate (controller)voidOverridesPViewDataChangeListener.Methods inherited from class javax.swing.JButton
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable, updateUIMethods 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, setVerticalTextPositionMethods 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, updateMethods 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, validateTreeMethods 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 anActionListenerto it. -
PIASimpleSearch
Constructs a generic search button with a label and adds anActionListenerto it.- Parameters:
label- theStringto use for the label
-
-
Method Details
-
unregister
Used to disassociate this component from its delegate (controller)- Specified by:
unregisterin interfacePClientComponent- Throws:
RemoteException
-
setModelHandle
Sets the data for the component to use.- Specified by:
setModelHandlein 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:
getModelHandlein 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 thatgetModelHandlealways returns null,setModelHandleis ignored, and no property change events are generated.- Specified by:
isLightin interfacePComponent- Returns:
- False, by default.
- Throws:
RemoteException- thrown for errors
-
getControllerClassName
Gets the class name for the controller of this class.- Specified by:
getControllerClassNamein interfacePComponent- Returns:
- A
Stringwith 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 defaultActionsupplied includes help for this component.- Specified by:
getToolsin interfacePClientComponent- Returns:
- A
Vectorthat containsActionobjects.
-
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:
setResourceNamein interfacePClientComponent- Parameters:
name- aStringthat contains the new base resource name
-
getResourceName
Gets the base resource name used in resource look up.- Specified by:
getResourceNamein interfacePClientComponent- Returns:
- A
Stringwith 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:
firePropertyChangein interfacePViewComponent- Overrides:
firePropertyChangein 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:
fireVetoableChangein interfacePViewComponent- Overrides:
fireVetoableChangein 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:
getRemoteComponentin interfacePViewComponent- Returns:
- A
PRemoteComponentreference 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 appropriategetmethods on the controller to get the data, as the() PViewDataChangeEventparameter is no longer used.- Specified by:
viewDataChangein interfacePViewDataChangeListener- Parameters:
event- thePViewDataChangeEventevent 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 searchActionoccurs.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
evt- the searchActionEvent
-
collectData
- Throws:
RemoteException
-