org.openbp.jaspira.propertybrowser.editor
Interface PropertyEditor

All Superinterfaces:
java.lang.Cloneable, Copyable
All Known Implementing Classes:
AbstractPropertyEditor, BooleanEditor, ComponentSelectionEditor, DataMemberPathSelectionEditor, IntegerEditor, MultiLineStringEditor, PathEditor, SelectionEditor, StringEditor

public interface PropertyEditor
extends Copyable, java.lang.Cloneable

Property editor interface.

Author:
Andreas Putz

Field Summary
 
Fields inherited from interface org.openbp.common.generic.Copyable
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW
 
Method Summary
 javax.swing.JComponent getComponent()
          Get the editor for the property.
 java.lang.Object getObject()
          Gets the the object to edit (object that own the property).
 PropertyEditorOwner getOwner()
          Gets the the owner of the editor.
 java.lang.String getParams()
          Gets the editor parameter values.
 PropertyBrowser getPropertyBrowser()
          Gets the property browser instance if this property is used within the context of an property browser.
 javax.swing.JComponent getPropertyComponent()
          Get the editor for the property.
 java.lang.String getPropertyName()
          Gets the property name.
 PropertyValidator getValidator()
          Gets the the property validator used by this property editor.
 java.lang.Object getValue()
          Gets the the actual property value.
 void initialize(java.lang.String params)
          Sets the editor parameters and initializes the editor.
 boolean isReadonly()
          Gets the read only flag.
 void loadProperty()
          Loads the property value from the object and displays it in the property component.
 void propertyChanged()
          When a change in the property value has occurred, then this method is to be called.
 void resetComponentDisplay()
          Resets the display of the editor.
 void resetProperty()
          Resets the property to its original value.
 boolean saveProperty()
          Saves the changes made to the property value if the property was modified.
 void setObject(java.lang.Object object)
          Sets the object that holds the property specified by setPropertyName(java.lang.String)
 void setOwner(PropertyEditorOwner owner)
          Sets the the owner of the editor.
 void setParams(java.lang.String params)
          Sets the editor parameter values.
 void setPropertyBrowser(PropertyBrowser propertyBrowser)
          Sets the property browser instance if this property is used within the context of an property browser.
 void setPropertyName(java.lang.String propertyName)
          Sets the name of the property that should be edited by this editor instance.
 void setReadonly(boolean readonly)
          Sets the read only flag.
 void setValidator(PropertyValidator validator)
          Sets the the property validator used by this property editor.
 void setValue(java.lang.Object value)
          Sets the the actual property value.
 
Methods inherited from interface org.openbp.common.generic.Copyable
clone, copyFrom
 

Method Detail

initialize

void initialize(java.lang.String params)
Sets the editor parameters and initializes the editor.

Parameters:
params - Editor parameters from the property descriptor or null

loadProperty

void loadProperty()
Loads the property value from the object and displays it in the property component.


saveProperty

boolean saveProperty()
Saves the changes made to the property value if the property was modified. The method will will validate the modified value, if a PropertyValidator has been set and then on success save the property value.

Returns:
true The property value has been successfully validated and saved.
false Validation or saving failed.

resetProperty

void resetProperty()
Resets the property to its original value.


propertyChanged

void propertyChanged()
When a change in the property value has occurred, then this method is to be called.


getPropertyComponent

javax.swing.JComponent getPropertyComponent()
Get the editor for the property. This will also initialize the component (if not done yet) and load the current property value from the object to be displayed.

Returns:
The property editor or null if the property cannot be accessed

getComponent

javax.swing.JComponent getComponent()
Get the editor for the property. This will also initialize the component (if not done yet), however it will \bnot\b load the current property value from the object to be displayed.

Returns:
The property editor or null if the property cannot be accessed

resetComponentDisplay

void resetComponentDisplay()
Resets the display of the editor. Shows the editor component in an 'unfocused' state.


setPropertyName

void setPropertyName(java.lang.String propertyName)
Sets the name of the property that should be edited by this editor instance.

Parameters:
propertyName - The property name

getPropertyName

java.lang.String getPropertyName()
Gets the property name.


setObject

void setObject(java.lang.Object object)
Sets the object that holds the property specified by setPropertyName(java.lang.String)

Parameters:
object - The object to edit

getObject

java.lang.Object getObject()
Gets the the object to edit (object that own the property).


getValue

java.lang.Object getValue()
Gets the the actual property value.


setValue

void setValue(java.lang.Object value)
Sets the the actual property value.


isReadonly

boolean isReadonly()
Gets the read only flag.


getParams

java.lang.String getParams()
Gets the editor parameter values.


setParams

void setParams(java.lang.String params)
Sets the editor parameter values.


setReadonly

void setReadonly(boolean readonly)
Sets the read only flag.


getValidator

PropertyValidator getValidator()
Gets the the property validator used by this property editor.


setValidator

void setValidator(PropertyValidator validator)
Sets the the property validator used by this property editor.


getOwner

PropertyEditorOwner getOwner()
Gets the the owner of the editor. This can be a component or a tree node if the pe is used by the property browser.


setOwner

void setOwner(PropertyEditorOwner owner)
Sets the the owner of the editor. This can be a component or a tree node if the pe is used by the property browser.


getPropertyBrowser

PropertyBrowser getPropertyBrowser()
Gets the property browser instance if this property is used within the context of an property browser.


setPropertyBrowser

void setPropertyBrowser(PropertyBrowser propertyBrowser)
Sets the property browser instance if this property is used within the context of an property browser.



Copyright © 2011. All Rights Reserved.