Runtime

## org.eclipse.gmf.runtime.common.ui.services.properties.extended
Class MultiButtonCellEditor

    java.lang.Object
      org.eclipse.jface.viewers.CellEditor
          org.eclipse.gmf.runtime.common.ui.services.properties.extended.MultiButtonCellEditor

Direct Known Subclasses:
  PropertyPageCellEditor

    public abstract class MultiButtonCellEditor

extends CellEditor

Cell editor that provides for a read-only label representation of the value and multiple buttons at the end. The last button receives the focus. The subclasses have to override the initButtons() method. The implementation of that method should only make calls to the method addButton() to initialize the desired buttons.

Nested Class Summary

Nested classes/interfaces inherited from class org.eclipse.jface.viewers.CellEditor
`CellEditor.LayoutData`

Field Summary

Fields inherited from class org.eclipse.jface.viewers.CellEditor
`COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO`

Constructor Summary
`MultiButtonCellEditor(Composite parent)`
`MultiButtonCellEditor(Composite parent, int style)`

Method Summary
`protected void` `addButton(java.lang.String buttonLabel, IPropertyAction buttonAction)` Creates and adds the button to the cell editor
`protected Control` `createControl(Composite parent)`
`protected java.lang.Object` `doGetValue()`
`protected void` `doSetFocus()` This implementations sets focus on the last button
`protected void` `doSetValue(java.lang.Object val)`
`protected Label` `getLabel()` Get the label widget.
`protected Text` `getText()` Get the text widget in the case where the label is modifiable.
`protected abstract void` `initButtons()` The subclasses have to override this method.
`protected boolean` `isModifiable()` Determine if the label in the cell editor is modifiable.
`protected void` `updateLabel(java.lang.Object val)` Updates the label showing the value.

Methods inherited from class org.eclipse.jface.viewers.CellEditor

`activate, activate, addListener, addPropertyChangeListener, create, deactivate, dispose, fireApplyEditorValue, fireCancelEditor, fireEditorValueChanged, fireEnablementChanged, focusLost, getControl, getErrorMessage, getLayoutData, getStyle, getValidator, getValue, isActivated, isCopyEnabled, isCorrect, isCutEnabled, isDeleteEnabled, isDirty, isFindEnabled, isPasteEnabled, isRedoEnabled, isSelectAllEnabled, isUndoEnabled, isValueValid, keyReleaseOccured, markDirty, performCopy, performCut, performDelete, performFind, performPaste, performRedo, performSelectAll, 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`

Constructor Detail

### MultiButtonCellEditor

    public MultiButtonCellEditor(Composite parent)

Parameters:
  `parent` - The parent control

### MultiButtonCellEditor

    public MultiButtonCellEditor(Composite parent,
                                 int style)

Parameters:
  `parent` - The parent control
  `style` - The style bits

Method Detail

### createControl

    protected Control createControl(Composite parent)

  Specified by:
    `createControl` in class `CellEditor`
  See Also:
    `CellEditor.createControl(org.eclipse.swt.widgets.Composite)`

### isModifiable

    protected boolean isModifiable()

  Determine if the label in the cell editor is modifiable. The default is a read-only label representation of the value.

  Returns:
    `true` if the label is modifiable

### doGetValue

    protected java.lang.Object doGetValue()

  Specified by:
    `doGetValue` in class `CellEditor`
  See Also:
    `CellEditor.doGetValue()`

### doSetFocus

    protected void doSetFocus()

  This implementations sets focus on the last button

  Specified by:
    `doSetFocus` in class `CellEditor`
  See Also:
    `CellEditor.doSetFocus()`

### doSetValue

    protected void doSetValue(java.lang.Object val)

  Specified by:
    `doSetValue` in class `CellEditor`
  See Also:
    `CellEditor.doSetValue(java.lang.Object)`

### addButton

    protected void addButton(java.lang.String buttonLabel,
                             IPropertyAction buttonAction)

  Creates and adds the button to the cell editor

  Parameters:
    `buttonLabel` - Button label
    `buttonAction` - The action to be executed when the button is invoked

### updateLabel

    protected void updateLabel(java.lang.Object val)

  Updates the label showing the value. The default implementation converts the passed object to a string using `toString` and sets this as the text of the label widget.

  Parameters:
    `val` - The new value

### initButtons

    protected abstract void initButtons()

  The subclasses have to override this method. The implementation should only make calls to the method addButton() to initialize the desired buttons. Note: the implementation of the IPropertyAction's execute method should return the new value for the editor or null if the value has not changed.

### getLabel

    protected Label getLabel()

  Get the label widget.

  Returns:
    the label widget.

### getText

    protected Text getText()

  Get the text widget in the case where the label is modifiable.

  Returns:
    the label widget.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.