public class CheckBoxCellEditor extends AbstractCellEditor
ICellEditor
implementation for checkbox editors.
Compared to a TextCellEditor, this editor will immediately commit
and close itself on interaction. This is the same behaviour like
a regular for a regular checkbox.cellStyle, configRegistry, conversionEditErrorHandler, dataValidator, displayConverter, editMode, labelStack, layerCell, validationEditErrorHandler
Constructor and Description |
---|
CheckBoxCellEditor() |
Modifier and Type | Method and Description |
---|---|
boolean |
activateAtAnyPosition()
This method is intended to be used by
IMouseEventMatcher implementations that need
to check for the editor and the click position to determine whether an editor should be
activated or not. |
protected org.eclipse.swt.widgets.Control |
activateCell(org.eclipse.swt.widgets.Composite parent,
Object originalCanonicalValue)
As soon as the editor is activated, flip the current data value and commit it.
|
org.eclipse.swt.widgets.Canvas |
createEditorControl(org.eclipse.swt.widgets.Composite parent)
Creates the editor control that is wrapped by this ICellEditor.
|
org.eclipse.swt.widgets.Canvas |
getEditorControl() |
Boolean |
getEditorValue()
Returns the current value in this editor prior to conversion.
|
void |
setEditorValue(Object value)
Sets the given value to editor control.
|
boolean |
supportMultiEdit(IConfigRegistry configRegistry,
List<String> configLabels)
Determines whether this editor supports multi edit behaviour or not.
|
activateCell, addEditorControlListeners, close, commit, commit, commit, getCanonicalValue, getCanonicalValue, getColumnIndex, getColumnPosition, getRowIndex, getRowPosition, handleConversion, isClosed, openAdjacentEditor, openInline, removeEditorControlListeners, setCanonicalValue, setDataValidator, validateCanonicalValue, validateCanonicalValue
protected org.eclipse.swt.widgets.Control activateCell(org.eclipse.swt.widgets.Composite parent, Object originalCanonicalValue)
activateCell
in class AbstractCellEditor
parent
- The parent Composite, needed for the creation of the editor control.originalCanonicalValue
- The value that should be put to the activated editor control.Control
to be used for capturing the new cell value.public Boolean getEditorValue()
ICellEditor
public void setEditorValue(Object value)
AbstractCellEditor.setCanonicalValue(Object)
the
given value should be already a converted Boolean value. The only
other values accepted in here are null
which is interpreted
as false
and Strings than can be converted to Boolean
directly. Every other object will result in setting the editor value
to false
.value
- The display value to set to the wrapped editor control.public org.eclipse.swt.widgets.Canvas getEditorControl()
public org.eclipse.swt.widgets.Canvas createEditorControl(org.eclipse.swt.widgets.Composite parent)
ICellEditor
parent
- The Composite that will be the parent of the new editor control.
Can not be null
public boolean supportMultiEdit(IConfigRegistry configRegistry, List<String> configLabels)
ICellEditor
true
, on selecting and pressing F2 on several cells that are editable, having
the same editor type and converter registered, a multi edit dialog will open.
By default this method will return true
. You can change this behaviour by setting
the configuration attribute EditConfigAttributes.SUPPORT_MULTI_EDIT
.
You should consider returning false
e.g. if the update operation is complex or
you use conditional validation, where a value is validated against another value in the data model.
supportMultiEdit
in interface ICellEditor
supportMultiEdit
in class AbstractCellEditor
configRegistry
- The IConfigRegistry
to retrieve the configuration for
multi edit support out of. Needed here because the instance IConfigRegistry
might not be set on calling this method.configLabels
- The labels out of the LabelStack of the cell whose editor should be activated.
Needed here because this method needs to be called prior to activation to determine
where to activate it.true
if this editor will open in a subdialog for multi editing, false
if the multi editing of this kind of cell editor is not supported.EditConfigAttributes.SUPPORT_MULTI_EDIT
public boolean activateAtAnyPosition()
ICellEditor
IMouseEventMatcher
implementations that need
to check for the editor and the click position to determine whether an editor should be
activated or not. By default this method will return true
. Special implementations
that need a different behaviour need to return false
instead. E.g. checkbox editors
should only be activated in case the icon that represents the checkbox is clicked.activateAtAnyPosition
in interface ICellEditor
activateAtAnyPosition
in class AbstractCellEditor
true
if this ICellEditor
should be activated by clicking at any
position in the corresponding cell, false
if there need to be a special
position clicked.Copyright © 2013. All Rights Reserved.