|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.jaspira.propertybrowser.editor.AbstractPropertyEditor
public abstract class AbstractPropertyEditor
The abstract property editor provides some of the generic methods needed by any property editor implementing the property editor interface.
| Field Summary | |
|---|---|
protected javax.swing.JComponent |
component
Display component |
protected PropertyEditorListener |
listener
Editor listener |
protected java.lang.Object |
object
The object to edit (object that owns the property) |
protected PropertyEditorOwner |
owner
The owner of the editor. |
protected EditorParameterParser |
parameterParser
Parameter parser |
protected java.lang.String |
params
Editor parameter values |
protected PropertyBrowser |
propertyBrowser
property browser instance if this property is used within the context of an property browser |
protected java.lang.String |
propertyName
Property name |
protected boolean |
readonly
Determines if the property is read only |
protected PropertyValidator |
validator
The property validator used by this property editor. |
protected java.lang.Object |
value
The actual property value |
protected boolean |
valueChanged
Flag set when the value has been edited |
protected boolean |
valueLoaded
Flag set when the value has been loaded from the property |
| Fields inherited from interface org.openbp.common.generic.Copyable |
|---|
COPY_DEEP, COPY_FIRST_LEVEL, COPY_SHALLOW |
| Constructor Summary | |
|---|---|
AbstractPropertyEditor()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a clone of this. |
void |
copyFrom(java.lang.Object source,
int copyMode)
Copies the values of the source object to this object. |
protected abstract void |
createComponent()
Creates the editor component of the property editor. |
void |
focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus. |
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus. |
protected void |
forwardKeyEvent(java.awt.event.KeyEvent e)
Forwards the given key event to the parent of the property editor component. |
javax.swing.JComponent |
getComponent()
Get the editor for the property. |
protected abstract java.lang.Object |
getComponentValue()
Gets the current editor component value. |
java.lang.Object |
getObject()
Gets the the object to edit (object that owns the property). |
PropertyEditorOwner |
getOwner()
Gets the the owner of the editor. |
EditorParameterParser |
getParameterParser()
Gets the parameter parser. |
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. |
protected java.lang.String |
getSafeString(java.lang.Object value)
Gets the string representation of the specified value. |
PropertyValidator |
getValidator()
Gets the the property validator used by this property editor. |
java.lang.Object |
getValue()
Gets the the actual property value. |
protected void |
highlight(boolean on)
Highlights the content of the component. |
void |
initialize(java.lang.String params)
Sets the editor parameters and initializes the editor. |
protected void |
initializeComponent()
Initializes the editor component. |
boolean |
isReadonly()
Gets the read only flag. |
void |
keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released. |
void |
keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed. |
void |
loadProperty()
Loads the property value from the object and displays it in the property component. |
protected void |
parseParams(EditorParameterParser parser)
Parses the editor parameters specified in the property descriptor. |
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. |
protected abstract void |
setComponentValue()
Sets the display component value from the associated property. |
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. |
protected boolean |
validateProperty(boolean complete)
Validates the edited value for this property, if a validator has been specified in the property descriptor file. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String propertyName
protected java.lang.String params
protected boolean readonly
protected PropertyValidator validator
protected PropertyEditorListener listener
protected PropertyEditorOwner owner
protected javax.swing.JComponent component
protected EditorParameterParser parameterParser
protected PropertyBrowser propertyBrowser
protected java.lang.Object object
protected java.lang.Object value
protected boolean valueLoaded
protected boolean valueChanged
| Constructor Detail |
|---|
public AbstractPropertyEditor()
| Method Detail |
|---|
public void initialize(java.lang.String params)
initialize in interface PropertyEditorparams - Editor parameters from the property descriptor or null
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface Copyableclone in class java.lang.Objectjava.lang.CloneNotSupportedException - If the cloning of one of the contained objects failed
public void copyFrom(java.lang.Object source,
int copyMode)
throws java.lang.CloneNotSupportedException
copyFrom in interface Copyablesource - The source object. Must be of the same type as this object.copyMode - Determines if a deep copy, a first level copy or a shallow copy is to be
performed. See the constants of the org.openbp.common.generic.description.Copyable class.
java.lang.CloneNotSupportedException - If the cloning of one of the contained objects failedpublic EditorParameterParser getParameterParser()
protected abstract void setComponentValue()
protected abstract java.lang.Object getComponentValue()
protected abstract void createComponent()
protected void highlight(boolean on)
on - true Turns the highlight on if the component has the focuspublic void propertyChanged()
propertyChanged in interface PropertyEditorpublic void loadProperty()
loadProperty in interface PropertyEditorpublic boolean saveProperty()
PropertyValidator has been set and then
on success save the property value.
saveProperty in interface PropertyEditorpublic void resetProperty()
resetProperty in interface PropertyEditorprotected boolean validateProperty(boolean complete)
saveProperty() method.
complete - true The value has been completely entered. This is the case if the user wishes to leave the field.public javax.swing.JComponent getPropertyComponent()
getPropertyComponent in interface PropertyEditorpublic javax.swing.JComponent getComponent()
getComponent in interface PropertyEditorprotected void initializeComponent()
public void resetComponentDisplay()
resetComponentDisplay in interface PropertyEditorprotected void parseParams(EditorParameterParser parser)
parser - Parameter parserpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void focusGained(java.awt.event.FocusEvent e)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost in interface java.awt.event.FocusListenerpublic void setPropertyName(java.lang.String propertyName)
setPropertyName in interface PropertyEditorpropertyName - The property namepublic java.lang.String getPropertyName()
getPropertyName in interface PropertyEditorpublic void setObject(java.lang.Object object)
setPropertyName(java.lang.String)
setObject in interface PropertyEditorobject - The object to editpublic java.lang.Object getObject()
getObject in interface PropertyEditorpublic java.lang.Object getValue()
getValue in interface PropertyEditorpublic void setValue(java.lang.Object value)
setValue in interface PropertyEditorpublic boolean isReadonly()
isReadonly in interface PropertyEditorpublic void setReadonly(boolean readonly)
setReadonly in interface PropertyEditorpublic java.lang.String getParams()
getParams in interface PropertyEditorpublic void setParams(java.lang.String params)
setParams in interface PropertyEditorpublic PropertyValidator getValidator()
getValidator in interface PropertyEditorpublic void setValidator(PropertyValidator validator)
setValidator in interface PropertyEditorpublic PropertyEditorOwner getOwner()
getOwner in interface PropertyEditorpublic void setOwner(PropertyEditorOwner owner)
setOwner in interface PropertyEditorpublic PropertyBrowser getPropertyBrowser()
getPropertyBrowser in interface PropertyEditorpublic void setPropertyBrowser(PropertyBrowser propertyBrowser)
setPropertyBrowser in interface PropertyEditorprotected java.lang.String getSafeString(java.lang.Object value)
value - Value or null
protected void forwardKeyEvent(java.awt.event.KeyEvent e)
e - Event
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||