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

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.properties.KiemPropertyType
      extended by de.cau.cs.kieler.sim.kiem.properties.KiemPropertyTypeWorkspaceFile
All Implemented Interfaces:
IKiemPropertyType

public class KiemPropertyTypeWorkspaceFile
extends KiemPropertyType
implements IKiemPropertyType

The Class KiemPropertyTypeWorkspaceFile. This implements a sample KiemPropertyType that uses a customized Eclipse dialog to browse for a workspace file.

Rating yellow
(2009-01-15)

Nested Class Summary
 class KiemPropertyTypeWorkspaceFile.CustomDialogCellEditor
          The Class CustomDialogCellEditor.
 
Constructor Summary
KiemPropertyTypeWorkspaceFile()
          Instantiates a new KiemPropertyType workspace file.
 
Method Summary
 String[] getFilterExts()
          Gets the filter extensions.
 String[] getFilterNames()
          Gets the filter extension names.
 Object getValue(KiemProperty property)
          This method bridges String file location values (encoded as Strings in property) and the String displayed in the String cell editor.
static IPath getValueAsIPath(KiemProperty property)
          Gets the value as file.
 CellEditor provideCellEditor(Composite parent)
          Provides a cell editor of this KiemPropertyType.
 Image provideIcon()
          Provide an icon Image for this KiemPropertyType.
 void setFilterExts(String[] filterExtsParam)
          Sets the filter extensions.
 void setFilterNames(String[] filterNamesParam)
          Sets the filter extension names.
 void setValue(KiemProperty property, Object value)
          This method bridges String file location values (encoded as Strings in property) and the String displayed in the String cell editor.
 
Methods inherited from class de.cau.cs.kieler.sim.kiem.properties.KiemPropertyType
getCellEditor, getIcon, getId, setCellEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KiemPropertyTypeWorkspaceFile

public KiemPropertyTypeWorkspaceFile()
Instantiates a new KiemPropertyType workspace file.

Method Detail

getValue

public Object getValue(KiemProperty property)
This method bridges String file location values (encoded as Strings in property) and the String displayed in the String cell editor. Gets the value of the property type. This method is called by the cell editor and its returned object depends on the latter. It returns the value that the cell editor can handle.
The concrete type of value is determined by the used cell editor and the type it can handle. The task of an implementation of this method is to bridge the property string type and the cell editor type.

Specified by:
getValue in interface IKiemPropertyType
Parameters:
property - the KiemProperty that this type operates on
Returns:
the value of the property with the type depending on the cell editor

setValue

public void setValue(KiemProperty property,
                     Object value)
This method bridges String file location values (encoded as Strings in property) and the String displayed in the String cell editor. Sets the value of the property type. This method is called by the cell editor and the object parameter depends on the latter. It gets the value from the cell editor and should store the appropriate string representation in the KIEM property.
The concrete type of value is determined by the used cell editor and the type it can handle. The task of an implementation of this method is to bridge the property string type and the cell editor type.

Specified by:
setValue in interface IKiemPropertyType
Parameters:
property - the KiemProperty that this type operates on
value - the value of the property with the type depending on the cell editor

getValueAsIPath

public static IPath getValueAsIPath(KiemProperty property)
Gets the value as file.

Parameters:
property - the property
Returns:
the value as file

provideIcon

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

Overrides:
provideIcon in class KiemPropertyType
Returns:
the icon Image to display in the KiemView table-tree

provideCellEditor

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

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

setFilterNames

public void setFilterNames(String[] filterNamesParam)
Sets the filter extension names.

Parameters:
filterNamesParam - the new filter names

getFilterNames

public String[] getFilterNames()
Gets the filter extension names.

Returns:
the filter names

setFilterExts

public void setFilterExts(String[] filterExtsParam)
Sets the filter extensions.

Parameters:
filterExtsParam - the new filter extensions

getFilterExts

public String[] getFilterExts()
Gets the filter extensions.

Returns:
the filter extensions