com.atomikos.beans
Interface Editor


public interface Editor

An Editor for getting and setting properties based on UI interaction. Note that editors do NOT operate on the original property but on a copy; in particular, any changes made through the editor have to be explicitly retrieved by calling getEditedObject and then set on the original property. For indexed properties, the editor should deal with the whole set at once.


Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Add a listener for property changes.
 Component getComponent()
          Get any GUI component for editing.
 Object getEditedObject()
          Retrieves the edited object.
 Property getProperty()
          Get the property for which we are editing.
 String getStringValue()
          Gets the value as a String.
 void removePropertyChangeListener(PropertyChangeListener l)
          Removes a property change listener.
 void setEditedObject(Object value)
          Set the object to edit.
 void setStringValue(String val)
          Sets the value as a String.
 

Method Detail

getProperty

Property getProperty()
Get the property for which we are editing.

Returns:
Property The property.

getEditedObject

Object getEditedObject()
Retrieves the edited object.

Returns:
Object The object that reflects any changes made through the editor interface.

setEditedObject

void setEditedObject(Object value)
Set the object to edit.

Parameters:
value - The object to edit.

setStringValue

void setStringValue(String val)
                    throws PropertyException
Sets the value as a String. Should only be called if getStringValue() returns a value different from null.

Parameters:
val - The value.
Throws:
PropertyException - If not supported.

getStringValue

String getStringValue()
                      throws PropertyException
Gets the value as a String.

Returns:
String The value as a string, or null if not available.
Throws:
PropertyException - On error.

getComponent

Component getComponent()
Get any GUI component for editing.

Returns:
Component The component, or null if not available.

addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener l)
Add a listener for property changes. Clients should register as listeners for detecting when the local copy of the property is set to a new value.

Parameters:
PropertyChangeListener - l The listener.

removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener l)
Removes a property change listener.

Parameters:
l - The listener.


Copyright © 2011. All Rights Reserved.