|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.KeyAdapter
com.metamatrix.toolbox.ui.widget.property.PropertyChangeAdapter
public class PropertyChangeAdapter
PropertyChangeAdapter is a class for obtaining, validating, and setting property values for all editable properties in the PropertiesPanel. The class listens to key and selection events from the various types of JComponent TableCellEditor implementations for the various PropertyDefinition types and adapts them to use the PropertiedObject methods isValidValue() and setValue().
Constructor Summary | |
---|---|
PropertyChangeAdapter(PropertiedObjectEditor editor,
java.lang.Object transactionSource)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when a component loses the keyboard focus. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the specified listener to be notified whenever the value of one of the displayed components changes. |
protected void |
firePropertyChangeEvent(java.lang.Object source,
java.lang.Object value)
Fires a PropertyChangeEvent to all registered listeners. |
void |
focusLost(java.awt.event.FocusEvent event)
Invoked when a component loses the keyboard focus. |
static java.lang.Object |
getValueFromJComponent(javax.swing.JComponent comp,
boolean finished)
Return the value object controlled by the specified JComponent TreeCellEditor. |
boolean |
isEditing()
determine if this Adapter is in the middle of a user edit. |
boolean |
isTransactionPending()
sets or clears the transactionPending flag |
boolean |
isValid(java.lang.Object value,
java.lang.Object nullObject)
|
void |
isValueValid(PropertyComponent source,
java.lang.Object value)
Callback from a custom component to check the validity of a partial entry. |
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released. |
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. |
protected void |
removeValidityListenerForJComponent(javax.swing.JComponent comp)
Remove this adapter from the specified component's listener list. |
protected void |
setEditorComponentAfterEdit(javax.swing.JComponent editor)
set this property's TableCellEditor just after editing of the value has completed. |
void |
setEditorComponentBeforeEdit(javax.swing.JComponent editor)
set this property's TableCellEditor just before editing of the value begins. |
void |
setJComponentValue(javax.swing.JComponent component,
java.lang.Object value)
|
void |
setPropertiedObject(PropertiedObject entity)
set the PropertiedObject that this adapter will be using for validation and setting of new property values. |
void |
setPropertyDefinition(PropertyDefinition propertyDefinition)
set the PropertyDefinition that this adapter will be controlling the value of for the PropertiedObject. |
void |
setTransactionPending(boolean isPending)
sets or clears the transactionPending flag |
protected void |
setValidityListenerForJComponent(javax.swing.JComponent comp)
Set this adapter as a listener to validate partial entries of non-constrained properties. |
Methods inherited from class java.awt.event.KeyAdapter |
---|
keyPressed, keyTyped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyChangeAdapter(PropertiedObjectEditor editor, java.lang.Object transactionSource)
Method Detail |
---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListenerpublic void setTransactionPending(boolean isPending)
public boolean isTransactionPending()
protected void firePropertyChangeEvent(java.lang.Object source, java.lang.Object value)
public void setPropertiedObject(PropertiedObject entity)
entity
- the PropertiedObject for setting this property value.public void setPropertyDefinition(PropertyDefinition propertyDefinition)
propertyDefinition
- the PropertyDefinition of this property.public boolean isEditing()
public void setEditorComponentBeforeEdit(javax.swing.JComponent editor)
editor
- the JComponent responsible for editing this property value.protected void setEditorComponentAfterEdit(javax.swing.JComponent editor)
editor
- the JComponent responsible for editing this property value.protected void setValidityListenerForJComponent(javax.swing.JComponent comp)
protected void removeValidityListenerForJComponent(javax.swing.JComponent comp)
public void isValueValid(PropertyComponent source, java.lang.Object value)
isValueValid
in interface PropertyValidationListener
source
- the custom PropertyComponent requesting validation.value
- the property value that should be validated.public boolean isValid(java.lang.Object value, java.lang.Object nullObject)
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
keyReleased
in class java.awt.event.KeyAdapter
public void focusLost(java.awt.event.FocusEvent event)
public void actionPerformed(java.awt.event.ActionEvent e)
public static java.lang.Object getValueFromJComponent(javax.swing.JComponent comp, boolean finished)
comp
- the JComponent that this method will extract the value from.
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener currently registered to receive eventspublic void setJComponentValue(javax.swing.JComponent component, java.lang.Object value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |