de.cau.cs.kieler.sim.kiem.properties
Class KiemPropertyType

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.properties.KiemPropertyType
All Implemented Interfaces:
IKiemPropertyType
Direct Known Subclasses:
KiemPropertyTypeBool, KiemPropertyTypeChoice, KiemPropertyTypeEditor, KiemPropertyTypeFile, KiemPropertyTypeInt, KiemPropertyTypeString, KiemPropertyTypeWorkspaceFile

public abstract class KiemPropertyType
extends Object
implements IKiemPropertyType

The abstract class KiemPropertyType. This implements the basic and default behavior of a KiemPropertyType. A new KiemPropertyType must extend this abstract class and may provide its own CellEditor by overriding provideCellEditor(Composite). It may also provide its own icon Image by overriding the provideIcon() method. By default the TextCellEditor and a blank default property icon will be used.

Rating yellow
(2009-01-15)

Constructor Summary
KiemPropertyType()
          Instantiates a new KiemPropertyType.
 
Method Summary
 CellEditor getCellEditor()
          Gets the CellEditor that is used for this KiemPropertyType.
 Image getIcon()
          Gets the icon Image of this KiemPropertyType.
 String getId()
          Gets the id of the property type.
 CellEditor provideCellEditor(Composite parent)
          Provides a cell editor of this KiemPropertyType.
 Image provideIcon()
          Provide an icon Image for this KiemPropertyType.
 void setCellEditor(Composite parent)
          Sets the default cell editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.cau.cs.kieler.sim.kiem.properties.IKiemPropertyType
getValue, setValue
 

Constructor Detail

KiemPropertyType

public KiemPropertyType()
Instantiates a new KiemPropertyType. The cell editor will be created when the KiemPropertyEditing.getCellEditor(java.lang.Object) is called by the EditingSupport of the KiemView table-tree.

Method Detail

getId

public final String getId()
Gets the id of the property type.

Returns:
the id

provideCellEditor

public CellEditor provideCellEditor(Composite parent)
Provides a cell editor of this KiemPropertyType. This method may be overridden by implementing classes. By default it provides a TextCellEditor.

Parameters:
parent - the parent SWT composite that holds the Cell Editor
Returns:
the cell editor for this KiemPropertyType

provideIcon

public Image provideIcon()
Provide an icon Image for this KiemPropertyType. This method may be overridden by implementing classes. By default it provides a plain property icon.

Returns:
the icon Image to display in the KiemView table-tree

setCellEditor

public final void setCellEditor(Composite parent)
Sets the default cell editor. This method is called by the EditingSupport and should be left untouched. Please use the method provideCellEditor(Composite) to provide a different than the default CellEditor.

Parameters:
parent - the parent SWT composite that holds the Cell Editor

getCellEditor

public final CellEditor getCellEditor()
Gets the CellEditor that is used for this KiemPropertyType. This method is called by the EditingSupport and should be left untouched. Please use the method provideCellEditor(Composite) to provide a different than the default CellEditor.

Returns:
the CellEditor

getIcon

public final Image getIcon()
Gets the icon Image of this KiemPropertyType. This method is called by the LabelProvide and should be left untouched. Please use the method provideIcon() to provide a different than the default icon Image.

Returns:
the icon Image