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

java.lang.Object
  extended by org.eclipse.jface.viewers.CellEditor
      extended by org.eclipse.jface.viewers.TextCellEditor
          extended by de.cau.cs.kieler.sim.kiem.properties.EditableDialogCellEditor
Direct Known Subclasses:
KiemPropertyTypeFile.CustomDialogCellEditor

public abstract class EditableDialogCellEditor
extends TextCellEditor

En editable DialogCell editor.

Rating yellow
(2009-01-15)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.viewers.CellEditor
CellEditor.LayoutData
 
Field Summary
static String CELL_EDITOR_IMG_DOTS_BUTTON
          Image registry key for three dot image (value "cell_editor_dots_button_image").
 
Fields inherited from class org.eclipse.jface.viewers.TextCellEditor
text
 
Fields inherited from class org.eclipse.jface.viewers.CellEditor
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO
 
Constructor Summary
  EditableDialogCellEditor(boolean isEditableParam)
          Creates a new dialog cell editor with no control.
protected EditableDialogCellEditor(Composite parent, boolean isEditableParam)
          Creates a new dialog cell editor parented under the given control.
protected EditableDialogCellEditor(Composite parent, int style, boolean isEditableParam)
          Creates a new dialog cell editor parented under the given control.
 
Method Summary
protected  Button createButton(Composite parent)
          Creates the button for this cell editor under the given parent control.
protected  Control createControl(Composite parent)
           
 void deactivate()
           
protected  Object doGetValue()
           
protected  void doSetFocus()
           
protected  void doSetValue(Object valueParam)
           
protected  void focusLost()
          Processes a focus lost event that occurred in this cell editor.
 boolean isEditable()
          Checks whether editable is true.
protected abstract  Object openDialogBox(Control cellEditorWindow)
          Opens a dialog box under the given parent control and returns the dialog's value when it closes, or null if the dialog was canceled or no selection was made in the dialog.
 void setEditable(boolean isEditableParam)
          Sets the editable flag.
protected  void updateContents(Object valueParam)
          Updates the controls showing the value of this cell editor.
 
Methods inherited from class org.eclipse.jface.viewers.TextCellEditor
dependsOnExternalFocusListener, editOccured, getLayoutData, handleDefaultSelection, isCopyEnabled, isCutEnabled, isDeleteEnabled, isPasteEnabled, isSaveAllEnabled, isSelectAllEnabled, keyReleaseOccured, performCopy, performCut, performDelete, performPaste, performSelectAll
 
Methods inherited from class org.eclipse.jface.viewers.CellEditor
activate, activate, addListener, addPropertyChangeListener, create, deactivate, dispose, fireApplyEditorValue, fireCancelEditor, fireEditorValueChanged, fireEnablementChanged, getControl, getDoubleClickTimeout, getErrorMessage, getStyle, getValidator, getValue, isActivated, isCorrect, isDirty, isFindEnabled, isRedoEnabled, isUndoEnabled, isValueValid, markDirty, performFind, performRedo, performUndo, removeListener, removePropertyChangeListener, setErrorMessage, setFocus, setStyle, setValidator, setValue, setValueValid, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELL_EDITOR_IMG_DOTS_BUTTON

public static final String CELL_EDITOR_IMG_DOTS_BUTTON
Image registry key for three dot image (value "cell_editor_dots_button_image").

See Also:
Constant Field Values
Constructor Detail

EditableDialogCellEditor

public EditableDialogCellEditor(boolean isEditableParam)
Creates a new dialog cell editor with no control.

Parameters:
isEditableParam - the isEditable parameter
Since:
2.1

EditableDialogCellEditor

protected EditableDialogCellEditor(Composite parent,
                                   boolean isEditableParam)
Creates a new dialog cell editor parented under the given control. The cell editor value is null initially, and has no validator.

Parameters:
parent - the parent control
isEditableParam - the isEditable parameter

EditableDialogCellEditor

protected EditableDialogCellEditor(Composite parent,
                                   int style,
                                   boolean isEditableParam)
Creates a new dialog cell editor parented under the given control. The cell editor value is null initially, and has no validator.

Parameters:
parent - the parent control
style - the style bits
isEditableParam - the isEditable parameter
Since:
2.1
Method Detail

isEditable

public boolean isEditable()
Checks whether editable is true.

Returns:
true, if is editable

setEditable

public void setEditable(boolean isEditableParam)
Sets the editable flag.

Parameters:
isEditableParam - the new editable flag

createButton

protected Button createButton(Composite parent)
Creates the button for this cell editor under the given parent control.

The default implementation of this framework method creates the button display on the right hand side of the dialog cell editor. Subclasses may extend or reimplement.

Parameters:
parent - the parent control
Returns:
the new button control

createControl

protected Control createControl(Composite parent)
Overrides:
createControl in class TextCellEditor

deactivate

public void deactivate()
Overrides:
deactivate in class CellEditor

doGetValue

protected Object doGetValue()
Overrides:
doGetValue in class TextCellEditor

doSetFocus

protected void doSetFocus()
Overrides:
doSetFocus in class TextCellEditor

doSetValue

protected void doSetValue(Object valueParam)
Overrides:
doSetValue in class TextCellEditor

focusLost

protected void focusLost()
Processes a focus lost event that occurred in this cell editor.

The default implementation of this framework method applies the current value and deactivates the cell editor. Subclasses should call this method at appropriate times. Subclasses may also extend or reimplement.

Overrides:
focusLost in class CellEditor

openDialogBox

protected abstract Object openDialogBox(Control cellEditorWindow)
Opens a dialog box under the given parent control and returns the dialog's value when it closes, or null if the dialog was canceled or no selection was made in the dialog.

This framework method must be implemented by concrete subclasses. It is called when the user has pressed the button and the dialog box must pop up.

Parameters:
cellEditorWindow - the parent control cell editor's window so that a subclass can adjust the dialog box accordingly
Returns:
the selected value, or null if the dialog was canceled or no selection was made in the dialog

updateContents

protected void updateContents(Object valueParam)
Updates the controls showing the value of this cell editor.

The default implementation of this framework method just converts the passed object to a string using toString and sets this as the text of the label widget.

Subclasses may reimplement. If you reimplement this method, you should also reimplement createContents.

Parameters:
valueParam - the new value of this cell editor