|
||||||||||
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.PropertiedObjectPanel
public class PropertiedObjectPanel
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 |
---|
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.UIConstants |
---|
DATE_FORMAT_PROPERTY, SPACER_HORIZONTAL_LENGTH_PROPERTY, WINDOW_BORDER_PROPERTY |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PropertiedObjectPanel(PropertiedObjectEditor editor,
Encryptor encryptor)
Constructs and returns an instance of this class using itself as a transaction source. |
|
PropertiedObjectPanel(PropertiedObjectEditor editor,
Encryptor encryptor,
java.lang.Object transactionSource)
Constructs and returns an instance of this class. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the specified listener to be notified whenever the value of one of the displayed components changes. |
void |
addPropertySelectionListener(PropertySelectionListener listener)
|
void |
clear()
Clears the panel contents. |
void |
clearHiddenPropertyDefinitions()
Clear the list of properties not to display. |
void |
createComponent()
Construct the visual components for this object. |
protected javax.swing.JComponent |
createComponentFromPropertyDefinition(PropertyDefinition def,
java.lang.Object val,
boolean isReadOnly,
int ndx,
PropertyDefinitionLabel nameComp)
|
protected javax.swing.JComponent[][] |
createModelFromProperties()
Creates and returns the 2D object array table model for the properties of the MetadataEntity. |
protected java.util.List |
filterPropertyDefinitionList(java.util.Collection defs)
Build a modifiable List of the specified PropertyDefintions based on if the configurable settings for this panel. |
java.util.List |
getInvalidDefinitions()
Returns a List of the PropertyDefinitions for which the value columns displayed in the panel are invalid for this PropertiedObject. |
int |
getNameColumnHeaderWidth()
|
PropertiedObject |
getPropertiedObject()
|
PropertyChangeAdapter |
getPropertyChangeAdapter()
|
PropertyComponentFactory |
getPropertyComponentFactory()
|
java.awt.Component[] |
getPropertyComponents()
|
javax.swing.JScrollPane |
getScrollPane()
|
boolean |
getShowExpertProperties()
|
boolean |
getShowHiddenProperties()
|
boolean |
getShowInvalidProperties()
|
boolean |
getShowOptionalProperties()
|
boolean |
getShowRequiredProperties()
|
protected boolean |
hasValidValue(PropertyDefinition def,
java.lang.Object value)
|
boolean |
isEditing()
Determines if this panel is in the act of editing a property. |
boolean |
isFocusCycleRoot()
Indicates whether this panel is acting as a root focus handler when cycling through fields using [Tab]/[Shift-Tab]. |
boolean |
isReadOnlyForced()
Indicates whether read-only state is currently forced |
void |
refreshDisplay()
Refresh the panel's displayed contents. |
protected void |
refreshDisplay(boolean defaultValuesUsed)
Refresh the panel's displayed contents. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Unregisters the specified listener from getting notifications of value changes within the component displaying values for one of the PropertiedObject's properties. |
void |
removePropertySelectionListener(PropertySelectionListener listener)
|
void |
requestFocus()
Overridden to call requestFocus on the component containing the first property value. |
void |
resetNameColumnHeaderWidth(boolean refreshImmediately)
Resets the width of the header for the name column to it's default size and refreshes the display. |
protected void |
resizeNameColumn()
Resizes the name column to exactly fit its labels (including the header label) plus a small gap. |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setColumnHeaderNames(java.lang.String nameColumnName,
java.lang.String valueColumnName)
Sets each column header name to the respective specified name, or to the default value if the name is null. |
void |
setFocusCycleRoot(boolean isFocusCycleRoot)
Sets whether this panel should act as a root focus handler when cycling through fields using [Tab]/[Shift-Tab]. |
void |
setHiddenPropertyDefinitions(java.util.Collection propertiesToFilterOut)
Sets the properties that should not be shown. |
void |
setNameColumnHeaderWidth(int width)
Sets the width of the header for the name column. |
void |
setPropertiedObject(PropertiedObject propObj)
Sets this panel to display the properties for the specified PropertiedObject. |
void |
setPropertiedObject(PropertiedObject propObj,
java.util.List propertiesToDisplay)
Sets this panel to display the specified properties for the specified PropertiedObject. |
void |
setPropertiedObject(PropertiedObject propObj,
PropertiedObjectEditor editor)
Sets this panel to display the properties for the specified PropertiedObject. |
void |
setPropertiedObject(PropertiedObject propObj,
PropertiedObjectEditor editor,
java.util.List propertiesToDisplay)
Sets the PropertiedObject whose properties are to be shown to the specified object. |
void |
setPropertyChangeAdapter(PropertyChangeAdapter adapter)
Sets the PropertyChangeAdapter. |
void |
setReadOnlyForced(boolean forced)
Sets whether properties should be treated as read-only regardless of their actual read-only status. |
void |
setShowColumnHeaders(boolean showHeaders)
Sets whether the name and value column headers should be shown. |
void |
setShowExpertProperties(boolean showExpert)
Sets whether properties marked as expert should be shown. |
void |
setShowHiddenProperties(boolean showHidden)
Sets whether properties marked as hidden should be shown. |
void |
setShowInvalidProperties(boolean showInvalid)
Sets whether properties with invalid values should be shown with a special indication. |
void |
setShowOptionalProperties(boolean show)
Sets whether properties not marked as required (i.e., optional properties) should be shown. |
void |
setShowRequiredProperties(boolean showRequired)
Sets whether properties marked as required should be shown with a special indication. |
void |
setShowToolTips(boolean showToolTips)
Sets whether this panel should display ToolTips for property values. |
protected void |
sizeColumnsToFitViewport(javax.swing.JScrollPane scroller)
Attempts to resize the columns when the vertical scroll bar first appears in order to eliminate the horizontal scroll bar. |
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, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, 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, 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, repaint, repaint, repaint, resize, resize, 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 |
Constructor Detail |
---|
public PropertiedObjectPanel(PropertiedObjectEditor editor, Encryptor encryptor)
public PropertiedObjectPanel(PropertiedObjectEditor editor, Encryptor encryptor, java.lang.Object transactionSource)
Method Detail |
---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in class java.awt.Container
listener
- The PropertyChangeListenerpublic void addPropertySelectionListener(PropertySelectionListener listener)
public void clear()
public void clearHiddenPropertyDefinitions()
public void createComponent()
protected javax.swing.JComponent createComponentFromPropertyDefinition(PropertyDefinition def, java.lang.Object val, boolean isReadOnly, int ndx, PropertyDefinitionLabel nameComp)
protected javax.swing.JComponent[][] createModelFromProperties()
protected java.util.List filterPropertyDefinitionList(java.util.Collection defs)
public java.util.List getInvalidDefinitions()
public int getNameColumnHeaderWidth()
public PropertiedObject getPropertiedObject()
public PropertyChangeAdapter getPropertyChangeAdapter()
public PropertyComponentFactory getPropertyComponentFactory()
public java.awt.Component[] getPropertyComponents()
public javax.swing.JScrollPane getScrollPane()
public boolean getShowExpertProperties()
public boolean getShowHiddenProperties()
public boolean getShowInvalidProperties()
public boolean getShowOptionalProperties()
public boolean getShowRequiredProperties()
protected boolean hasValidValue(PropertyDefinition def, java.lang.Object value)
public boolean isEditing()
// button listener method that will use the currently displayed PropertiedObject public void actionPerformed(final ActionEvent e) { if (propertiedObjectPanel.isEditing()) { // the panel has not finished setting values on the PropertiedObject SwingUtilities.invokeLater(new Runnable() { public void run() { // call back on this method and try again actionPerformed(e); } }); return; } // the PropertiedObject is safe to use }
public boolean isFocusCycleRoot()
isFocusCycleRoot
in class java.awt.Container
public boolean isReadOnlyForced()
public void refreshDisplay()
protected void refreshDisplay(boolean defaultValuesUsed)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in class java.awt.Component
listener
- The PropertyChangeListener currently registered to receive eventspublic void removePropertySelectionListener(PropertySelectionListener listener)
public void requestFocus()
requestFocus
in class javax.swing.JComponent
protected void resizeNameColumn()
public void setBounds(int x, int y, int width, int height)
setBounds
in class java.awt.Component
public void setColumnHeaderNames(java.lang.String nameColumnName, java.lang.String valueColumnName)
nameColumnName
- The new name of the name columnvalueColumnName
- The new name of the value columnpublic void setFocusCycleRoot(boolean isFocusCycleRoot)
setFocusCycleRoot
in class java.awt.Container
isFocusCycleRoot
- True if this panel should act as a focus cycle rootpublic void setHiddenPropertyDefinitions(java.util.Collection propertiesToFilterOut)
propertiesToFilterOut
- The Collection of PropertyDefinitions that should not be shownpublic void setNameColumnHeaderWidth(int width)
width
- The width of the header for the name column. If width is set to 0, the name
column width will be reset to fit the name column data.public void resetNameColumnHeaderWidth(boolean refreshImmediately)
refreshImmediately
- if true, will cause the panel to refresh it's layout. Use
false when your code will be calling setPropertiedObject() to avoid unnecessary re-
generation of the panel's components.public void setPropertiedObject(PropertiedObject propObj)
propObj
- the PropertiedObject to display and edit in this panel.public void setPropertiedObject(PropertiedObject propObj, PropertiedObjectEditor editor)
propObj
- the PropertiedObject to display and edit in this panel.editor
- the PropertiedObjectEditor to use for displaying and editing.public void setPropertiedObject(PropertiedObject propObj, java.util.List propertiesToDisplay)
propObj
- the PropertiedObject to display and edit in this panel.
the panel will display.definitionsToDisplay
- a subset of the PropertyDefinitions for this PropertiedObject thatpublic void setPropertiedObject(PropertiedObject propObj, PropertiedObjectEditor editor, java.util.List propertiesToDisplay)
propObj
- The PropertiedObject to display and edit in this panel.editor
- The PropertiedObjectEditor to use for displaying and editing.propertiesToDisplay
- An ordered List of PropertyDefinitions for the properties to be shown for the PropertiedObjectpublic void setPropertyChangeAdapter(PropertyChangeAdapter adapter)
adapter
- The new PropertyChangeAdapterpublic void setReadOnlyForced(boolean forced)
readOnly
- True if all properties should be treated as read-only. The default is false.public void setShowColumnHeaders(boolean showHeaders)
showHeaders
- True if column headers should be shown. The default is true.public void setShowExpertProperties(boolean showExpert)
showExpert
- True if expert properties should be shown. The default is false.public void setShowHiddenProperties(boolean showHidden)
showHidden
- True if hidden properties should be shown. The default is false.public void setShowInvalidProperties(boolean showInvalid)
showInvalid
- True if invalid properties should be shown. The default is false.public void setShowOptionalProperties(boolean show)
show
- True if optional properties should be shown. The default is true.public void setShowRequiredProperties(boolean showRequired)
showRequired
- True if required properties should be shown. The default is false.public void setShowToolTips(boolean showToolTips)
showToolTips
- True if ToolTips should be shown. The default is true.protected void sizeColumnsToFitViewport(javax.swing.JScrollPane scroller)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |