|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.metamatrix.toolbox.ui.widget.property.MultivaluedPropertyComponent
public class MultivaluedPropertyComponent
MultivaluedPropertyComponent is a compound JPanel for displaying and editing values for multi-valued properties. It is also an example of how PropertyComponent can be implemented and used as complex property renderer/editor.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.Box |
buttonBox
|
protected java.awt.event.FocusListener |
focusListener
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, 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 |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.metamatrix.toolbox.ui.widget.property.PropertyComponent |
---|
EMPTY_STRING |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
MultivaluedPropertyComponent(PropertyDefinition def,
java.lang.Object data,
boolean readOnly,
int index,
PropertiedObject object,
PropertiedObjectEditor editor)
|
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
|
protected void |
addButtonPressed()
|
void |
addFocusListener(java.awt.event.FocusListener listener)
|
void |
editingStarted()
Notify this component that it has been activated and should enable any controls necessary for editing property values. |
void |
editingStopped()
Notification to this component that keyboard/mouse focus has moved away from the component and it should deselect any items and deactivate any editing controls. |
protected void |
fireFocusEvent(java.awt.event.FocusEvent event)
|
protected java.lang.String |
getInputValue()
|
protected java.util.List |
getList()
|
ListWidget |
getListWidget()
|
java.lang.Object |
getNullValue()
Get the null value for this PropertyComponent. |
protected ButtonWidget |
getRemoveButton()
|
javax.swing.JComponent |
getSingleRowComponent()
create a single-row JComponent from this component when needed. |
java.lang.String |
getSingleRowString()
create a String from this component when needed. |
java.lang.Object |
getValue()
Get the value being displayed by this component. |
protected void |
initializeMultivaluedPropertyComponent()
|
boolean |
isCurrentValueEqualTo(java.lang.Object value)
Return whether or not the specified value Object is equal to this component's currently displayed value. |
boolean |
isFocusTraversable()
|
protected void |
moreButtonPressed()
called by the moreButton's action processor method. |
protected void |
processFocusLostEvent(java.awt.event.FocusEvent event)
|
void |
removeActionListener(java.awt.event.ActionListener listener)
|
protected void |
removeButtonPressed()
|
void |
removeFocusListener(java.awt.event.FocusListener listener)
|
void |
removePropertyValidationListener(PropertyValidationListener listener)
Remove the PropertyValidationListener for this component. |
void |
setEnabled(boolean flag)
Set whether or not this component should be enabled to allow user editing of the value(s). |
void |
setPropertyValidationListener(PropertyValidationListener listener)
Set a listener on this component that will receive request to validate property values as they are entered. |
void |
setValidity(boolean flag)
Set a visual indication that this component's displayed value is or is not valid in the current context. |
protected void |
updateList()
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, addImpl, 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, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected javax.swing.Box buttonBox
protected java.awt.event.FocusListener focusListener
Constructor Detail |
---|
public MultivaluedPropertyComponent(PropertyDefinition def, java.lang.Object data, boolean readOnly, int index, PropertiedObject object, PropertiedObjectEditor editor)
Method Detail |
---|
protected void addButtonPressed()
protected java.lang.String getInputValue()
protected void moreButtonPressed()
public void addActionListener(java.awt.event.ActionListener listener)
addActionListener
in interface PropertyComponent
public void addFocusListener(java.awt.event.FocusListener listener)
addFocusListener
in interface PropertyComponent
addFocusListener
in class java.awt.Component
protected void fireFocusEvent(java.awt.event.FocusEvent event)
protected java.util.List getList()
public ListWidget getListWidget()
protected ButtonWidget getRemoveButton()
public java.lang.Object getValue()
getValue
in interface PropertyComponent
public boolean isFocusTraversable()
isFocusTraversable
in class java.awt.Component
protected void processFocusLostEvent(java.awt.event.FocusEvent event)
protected void initializeMultivaluedPropertyComponent()
protected void removeButtonPressed()
public void setEnabled(boolean flag)
setEnabled
in interface PropertyComponent
setEnabled
in class javax.swing.JComponent
flag
- true if the component should enable editing.public java.lang.Object getNullValue()
getNullValue
in interface PropertyComponent
public void setPropertyValidationListener(PropertyValidationListener listener)
Set a listener on this component that will receive request to validate property values as they are entered. An example would be a custom component that allows a user to type in an entry that should be validated keystroke-by-keystroke. Such a component would route KeyListener.keyReleased() events to the PropertyValidationListener.checkValue(Object) method. The result of the checkValue call will be communicated to this component via the setValidity(boolean) method.
Not all components require validation; therefore it is permissable for such components to no-op this method.
setPropertyValidationListener
in interface PropertyComponent
listener
- the PropertyValidationListener that this object should call if
validation is required.public void removePropertyValidationListener(PropertyValidationListener listener)
Remove the PropertyValidationListener for this component. This method will be called immediately after editing has stopped on this component. Implementations that no-op the setPropertyValidationListener method may no-op this method as well.
removePropertyValidationListener
in interface PropertyComponent
listener
- the PropertyValidationListener to be removed from this object.public void setValidity(boolean flag)
setValidity
in interface PropertyComponent
flag
- true if the value is valid, false if it is invalid.public boolean isCurrentValueEqualTo(java.lang.Object value)
isCurrentValueEqualTo
in interface PropertyComponent
value
- an Object that was previously obtained from this component's
getValue method.
public void editingStarted()
editingStarted
in interface PropertyComponent
public void editingStopped()
editingStopped
in interface PropertyComponent
public javax.swing.JComponent getSingleRowComponent()
getSingleRowComponent
in interface PropertyComponent
public java.lang.String getSingleRowString()
getSingleRowString
in interface PropertyComponent
public void removeActionListener(java.awt.event.ActionListener listener)
public void removeFocusListener(java.awt.event.FocusListener listener)
removeFocusListener
in class java.awt.Component
protected void updateList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |