public class ComboBoxViewerCellEditor extends CellEditor
ComboBoxCellEditor
it wraps the underlying CCombo
using a
ComboViewer
CellEditor.LayoutData
Modifier and Type | Field and Description |
---|---|
static int |
DROP_DOWN_ON_KEY_ACTIVATION
The list is dropped down when the activation is done through the keyboard
|
static int |
DROP_DOWN_ON_MOUSE_ACTIVATION
The list is dropped down when the activation is done through the mouse
|
static int |
DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION
The list is dropped down when the activation is done without
ui-interaction
|
static int |
DROP_DOWN_ON_TRAVERSE_ACTIVATION
The list is dropped down when the activation is done by traversing from
cell to cell
|
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO
Constructor and Description |
---|
ComboBoxViewerCellEditor(Composite parent)
Creates a new cell editor with a combo viewer and a default style
|
ComboBoxViewerCellEditor(Composite parent,
int style)
Creates a new cell editor with a combo viewer and the given style
|
Modifier and Type | Method and Description |
---|---|
void |
activate(ColumnViewerEditorActivationEvent activationEvent)
Activate the editor but also inform the editor which event triggered its
activation.
|
protected Control |
createControl(Composite parent)
Creates the control for this cell editor under the given parent control.
|
protected Object |
doGetValue()
The
ComboBoxCellEditor implementation of this
CellEditor framework method returns the zero-based index
of the current selection. |
protected void |
doSetFocus()
Sets the focus to the cell editor's control.
|
protected void |
doSetValue(Object value)
Set a new value
|
protected void |
focusLost()
Processes a focus lost event that occurred in this cell editor.
|
CellEditor.LayoutData |
getLayoutData()
The
ComboBoxCellEditor implementation of this
CellEditor framework method sets the minimum width of the
cell. |
ComboViewer |
getViewer() |
protected void |
keyReleaseOccured(KeyEvent keyEvent)
Processes a key release event that occurred in this cell editor.
|
void |
setActivationStyle(int activationStyle)
This method allows to control how the combo reacts when activated
|
void |
setContenProvider(IStructuredContentProvider provider)
Deprecated.
As of 3.7, replaced by
setContentProvider(IStructuredContentProvider) |
void |
setContentProvider(IStructuredContentProvider provider) |
void |
setInput(Object input) |
void |
setLabelProvider(IBaseLabelProvider labelProvider) |
activate, addListener, addPropertyChangeListener, create, deactivate, deactivate, dependsOnExternalFocusListener, dispose, fireApplyEditorValue, fireCancelEditor, fireEditorValueChanged, fireEnablementChanged, getControl, getDoubleClickTimeout, getErrorMessage, getStyle, getValidator, getValue, isActivated, isCopyEnabled, isCorrect, isCutEnabled, isDeleteEnabled, isDirty, isFindEnabled, isPasteEnabled, isRedoEnabled, isSelectAllEnabled, isUndoEnabled, isValueValid, markDirty, performCopy, performCut, performDelete, performFind, performPaste, performRedo, performSelectAll, performUndo, removeListener, removePropertyChangeListener, setErrorMessage, setFocus, setStyle, setValidator, setValue, setValueValid, valueChanged
public static final int DROP_DOWN_ON_MOUSE_ACTIVATION
public static final int DROP_DOWN_ON_KEY_ACTIVATION
public static final int DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION
public static final int DROP_DOWN_ON_TRAVERSE_ACTIVATION
public ComboBoxViewerCellEditor(Composite parent)
parent
- the parent controlpublic ComboBoxViewerCellEditor(Composite parent, int style)
parent
- the parent controlstyle
- the style bitsprotected Control createControl(Composite parent)
CellEditor
This framework method must be implemented by concrete subclasses.
createControl
in class CellEditor
parent
- the parent controlnull
if this cell editor has
no controlprotected Object doGetValue()
ComboBoxCellEditor
implementation of this
CellEditor
framework method returns the zero-based index
of the current selection.doGetValue
in class CellEditor
Integer
CellEditor.getValue()
protected void doSetFocus()
CellEditor
This framework method must be implemented by concrete subclasses.
doSetFocus
in class CellEditor
CellEditor.setFocus()
public CellEditor.LayoutData getLayoutData()
ComboBoxCellEditor
implementation of this
CellEditor
framework method sets the minimum width of the
cell. The minimum width is 10 characters if comboBox
is
not null
or disposed
eles it is 60 pixels
to make sure the arrow button and some text is visible. The list of
CCombo will be wide enough to show its longest item.getLayoutData
in class CellEditor
protected void doSetValue(Object value)
doSetValue
in class CellEditor
value
- the new valueCellEditor.setValue(java.lang.Object)
public void setLabelProvider(IBaseLabelProvider labelProvider)
labelProvider
- the label provider usedStructuredViewer.setLabelProvider(IBaseLabelProvider)
public void setContentProvider(IStructuredContentProvider provider)
provider
- the content provider usedStructuredViewer.setContentProvider(IContentProvider)
@Deprecated public void setContenProvider(IStructuredContentProvider provider)
setContentProvider(IStructuredContentProvider)
provider
- the content provider usedStructuredViewer.setContentProvider(IContentProvider)
public void setInput(Object input)
input
- the input usedStructuredViewer.setInput(Object)
public ComboViewer getViewer()
protected void focusLost()
CellEditor
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.
focusLost
in class CellEditor
protected void keyReleaseOccured(KeyEvent keyEvent)
CellEditor
The default implementation of this framework method cancels editing when the ESC key is pressed. When the RETURN key is pressed the current value is applied and the cell editor deactivates. Subclasses should call this method at appropriate times. Subclasses may also extend or reimplement.
keyReleaseOccured
in class CellEditor
keyEvent
- the key eventpublic void activate(ColumnViewerEditorActivationEvent activationEvent)
CellEditor
CellEditor.activate()
activate
in class CellEditor
activationEvent
- the editor activation eventpublic void setActivationStyle(int activationStyle)
activationStyle
- the style used
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.