com.metamatrix.toolbox.ui.widget.property
Class DirectoryEntryPropertyComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.metamatrix.toolbox.ui.widget.property.DirectoryEntryPropertyComponent
All Implemented Interfaces:
PropertyComponent, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class DirectoryEntryPropertyComponent
extends javax.swing.JPanel
implements PropertyComponent

DialogManager is a collection of static methods for accessing and displaying the MetaData Modeler application dialogs and wizards. DialogManager is responsible for determining and setting the parent frame for dialogs and determining dialog modality. The class represents a single point of control for dialogs that can be reused across the different parts of the application.

Author:
Steve Jacobs, John P. A. Verhaeg
See Also:
Serialized Form

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.widget.property.PropertyComponent
EMPTY_STRING
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DirectoryEntryPropertyComponent(java.lang.String dialogTitle, java.lang.String rootPath, DirectoryEntry homeEntry, int index)
           
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
           
 void addFocusListener(java.awt.event.FocusListener l)
          Manage the focus listener methods for the PropertyEventAdapter
 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 fireActionEvent()
           
 java.lang.Object getNullValue()
          Get the Object that this PropertyComponent will use to indicate null.
 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.
 boolean isCurrentValueEqualTo(java.lang.Object value)
          Return whether or not the specified value Object is equal to this component's currently displayed value.
protected  void processFocusLostEvent(java.awt.event.FocusEvent event)
           
 void removeActionListener(java.awt.event.ActionListener listener)
           
 void removeFocusListener(java.awt.event.FocusListener l)
          Manage the focus listener methods for the PropertyEventAdapter
 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.
 void showDirectoryChooserDialog(java.awt.Component c)
          show the DirectoryChooserDialog in the mode specified, showing the Modeler's Local Directory.
 
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, 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, 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
 

Constructor Detail

DirectoryEntryPropertyComponent

public DirectoryEntryPropertyComponent(java.lang.String dialogTitle,
                                       java.lang.String rootPath,
                                       DirectoryEntry homeEntry,
                                       int index)
Method Detail

processFocusLostEvent

protected void processFocusLostEvent(java.awt.event.FocusEvent event)
Since:
2.0

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Specified by:
addActionListener in interface PropertyComponent
Since:
Golden Gate

showDirectoryChooserDialog

public void showDirectoryChooserDialog(java.awt.Component c)
show the DirectoryChooserDialog in the mode specified, showing the Modeler's Local Directory.

Parameters:
trueForOpen - true if the dialog should be set to "open" mode, false for "save" mode.
trueForSaveModel - true if the dialog should configure to save Model files, false for saving project files. Value is not used if the operation mode is "open"
showModelAndProjectFilters -

addFocusListener

public void addFocusListener(java.awt.event.FocusListener l)
Manage the focus listener methods for the PropertyEventAdapter

Specified by:
addFocusListener in interface PropertyComponent
Overrides:
addFocusListener in class java.awt.Component

removeFocusListener

public void removeFocusListener(java.awt.event.FocusListener l)
Manage the focus listener methods for the PropertyEventAdapter

Overrides:
removeFocusListener in class java.awt.Component

fireActionEvent

protected void fireActionEvent()

getNullValue

public java.lang.Object getNullValue()
Get the Object that this PropertyComponent will use to indicate null. This Object will be used by the PropertyChangeAdapter to detect that a PropertiedObject's value for a particular PropertyDefintion is null, or, has no value. If the PropertyComponent returns an Object (not null), PropertyChangeAdapter will compare all Objects returned by the getValue() method to detect null. An example of the usage of this Object would be a text field which return an empty String to indicates that the specified property has no value.

Specified by:
getNullValue in interface PropertyComponent
Returns:
the Object that should be compared to the getValue() result to detect null. Implementations of this method may return null.

getValue

public java.lang.Object getValue()
Get the value being displayed by this component. This value will be obtained from the PropertyChangeAdapter immediately prior to and after editing. After the user has stopped editing the value, the isEqualTo() method will be called allowing this component to determine if the user has changed the value.

Specified by:
getValue in interface PropertyComponent
Returns:
the property's value. May be a single object or a Collection.

setEnabled

public void setEnabled(boolean flag)
Set whether or not this component should be enabled to allow user editing of the value(s).

Specified by:
setEnabled in interface PropertyComponent
Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
flag - true if the component should enable editing.

setPropertyValidationListener

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.

Specified by:
setPropertyValidationListener in interface PropertyComponent
Parameters:
listener - the PropertyValidationListener that this object should call if validation is required.

removePropertyValidationListener

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.

Specified by:
removePropertyValidationListener in interface PropertyComponent
Parameters:
listener - the PropertyValidationListener to be removed from this object.

setValidity

public void setValidity(boolean flag)
Set a visual indication that this component's displayed value is or is not valid in the current context. PropertyValidationListener calls this method after a request to checkValidity of a specified value. The method may also be called if an invalid entry exists after editing has completed. An example would be a collection of values that are required to be unique, but contain a repeated value.

Specified by:
setValidity in interface PropertyComponent
Parameters:
flag - true if the value is valid, false if it is invalid.

isCurrentValueEqualTo

public boolean isCurrentValueEqualTo(java.lang.Object value)
Return whether or not the specified value Object is equal to this component's currently displayed value. This method is called by PropertyChangeAdapter and allows the value comparison logic to reside within the custom component, rather than requiring custom components to hardcode comparison logic in the adapter.

Specified by:
isCurrentValueEqualTo in interface PropertyComponent
Parameters:
value - an Object that was previously obtained from this component's getValue method.
Returns:
true if the specified Object is the same as the value currently being displayed in this component, false if it is not. Returning true will cause the new value to be "set" on the target propertied object.

editingStarted

public void editingStarted()
Notify this component that it has been activated and should enable any controls necessary for editing property values.

Specified by:
editingStarted in interface PropertyComponent

editingStopped

public 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.

Specified by:
editingStopped in interface PropertyComponent

getSingleRowComponent

public javax.swing.JComponent getSingleRowComponent()
create a single-row JComponent from this component when needed.

Specified by:
getSingleRowComponent in interface PropertyComponent

getSingleRowString

public java.lang.String getSingleRowString()
create a String from this component when needed.

Specified by:
getSingleRowString in interface PropertyComponent

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Since:
Golden Gate


Copyright © 2009. All Rights Reserved.