com.ibm.commons.swt.data.editors.api
Class AbstractObjectEditor

java.lang.Object
  extended by com.ibm.commons.swt.data.editors.api.PropertyEditor
      extended by com.ibm.commons.swt.data.editors.api.AbstractObjectEditor
All Implemented Interfaces:
IPropertyEditor
Direct Known Subclasses:
ObjectCollectionEditor, ObjectEditor

public abstract class AbstractObjectEditor
extends PropertyEditor

Base class for editing an object.

See Also:
PropertyEditor

Field Summary
 java.lang.String currentValue
           
 
Constructor Summary
AbstractObjectEditor()
           
 
Method Summary
protected abstract  void addObject(IClassDef newClassDef)
          Called when the 'Add' button is pressed.
 org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
          This method is called by the PropertyEditor during initialization.
protected  void doAddObject(IClassDef newClassDef)
           
protected  void doRemoveObject()
           
protected abstract  java.lang.String getAddText()
          Returns the text to appear on the 'Add' button, that is the button for creating a new 'Object'.
protected abstract  java.lang.String getDeleteText()
          Returns the text to appear on the 'Delete' button, that is the button for deleting an existing 'Object'.
protected abstract  IClassDef getExpectedClassDef()
          Returns the com.ibm.commons.iloader.node.IClassDef required to create a new Object.
 void initControlValue(CompositeEditor parent, java.lang.String value)
          Set the given value into the control created for this property editor.
protected abstract  void removeObject()
          Called when the 'Remove' (or delete) button is pressed.
 void setId(java.lang.String id)
          Allows the implementor to associate an ID attribute with this control.
 boolean stopEdit(CompositeEditor parent)
          Called to tell the current editor to stop editing the associated attribute.
 
Methods inherited from class com.ibm.commons.swt.data.editors.api.PropertyEditor
addPropertyEditorUpdateListener, addValidator, callDialog, getContextAttribute, getContextObject, getDefaultEditor, getDialogButtonAltText, getDialogButtonImage, getDialogButtonText, getEditor, getRenderedValue, getScriptMode, getTextValidator, getValidator, getWorkBenchPart, hasDialogButton, isScriptModeFixed, postModelUpdate, preModelUpdate, removePropertyEditorUpdateListener, setContextAttribute, setContextObject, setScriptMode, setValidator, setWorkBenchPart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentValue

public java.lang.String currentValue
Constructor Detail

AbstractObjectEditor

public AbstractObjectEditor()
Method Detail

createControl

public org.eclipse.swt.widgets.Control createControl(CompositeEditor parent)
Description copied from class: PropertyEditor
This method is called by the PropertyEditor during initialization. This method creates the control that is used by the PropertyEditor to edit the associated property.

Specified by:
createControl in class PropertyEditor
Parameters:
parent - - The parent of the control
Returns:
Control - The 'control' used to edit this property (control is used liberally here as a composite of controls could be returned).

setId

public void setId(java.lang.String id)
Description copied from class: PropertyEditor
Allows the implementor to associate an ID attribute with this control. This may be of use later when trying to identify the control.

Specified by:
setId in class PropertyEditor

getExpectedClassDef

protected abstract IClassDef getExpectedClassDef()
Returns the com.ibm.commons.iloader.node.IClassDef required to create a new Object.

Returns:
an instanceof IClassDef
See Also:
IClassDef

getAddText

protected abstract java.lang.String getAddText()
Returns the text to appear on the 'Add' button, that is the button for creating a new 'Object'.

Returns:

getDeleteText

protected abstract java.lang.String getDeleteText()
Returns the text to appear on the 'Delete' button, that is the button for deleting an existing 'Object'.

Returns:

doAddObject

protected void doAddObject(IClassDef newClassDef)

doRemoveObject

protected void doRemoveObject()

addObject

protected abstract void addObject(IClassDef newClassDef)
Called when the 'Add' button is pressed.

Parameters:
newClassDef -
See Also:
IClassDef

removeObject

protected abstract void removeObject()
Called when the 'Remove' (or delete) button is pressed.


initControlValue

public void initControlValue(CompositeEditor parent,
                             java.lang.String value)
Description copied from class: PropertyEditor
Set the given value into the control created for this property editor.

Specified by:
initControlValue in class PropertyEditor
See Also:
CompositeEditor

stopEdit

public boolean stopEdit(CompositeEditor parent)
Description copied from class: PropertyEditor
Called to tell the current editor to stop editing the associated attribute. Typically this will be called when the current CompositeEditor has lost focus.

Specified by:
stopEdit in class PropertyEditor
Parameters:
parent - - CompositeEditor
Returns:
boolean - returns true if the operation succeeded, otherwise returns false.