Class FilterRowComboBoxCellEditor
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
-
- org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor
-
- org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxCellEditor
-
- All Implemented Interfaces:
ICellEditor
public class FilterRowComboBoxCellEditor extends ComboBoxCellEditor
Specialisation of ComboBoxCellEditor that can only be created using an IComboBoxDataProvider. Will show a multiselect combobox with checkboxes and uses the FilterNatCombo as underlying control.- See Also:
FilterRowComboBoxDataProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
AbstractCellEditor.InlineFocusListener, AbstractCellEditor.InlineTraverseListener
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor
freeEdit, iconImage, maxVisibleItems, multiselect, multiselectTextPrefix, multiselectTextSuffix, multiselectValueSeparator, showDropdownFilter, useCheckbox
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
cellStyle, configRegistry, conversionEditErrorHandler, dataValidator, displayConverter, editMode, focusListener, labelStack, layerCell, parent, traverseListener, validationEditErrorHandler
-
-
Constructor Summary
Constructors Constructor Description FilterRowComboBoxCellEditor(IComboBoxDataProvider dataProvider)
Create a newFilterRowComboBoxCellEditor
based on the givenIComboBoxDataProvider
, showing the default number of items in the dropdown of the combo.FilterRowComboBoxCellEditor(IComboBoxDataProvider dataProvider, int maxVisibleItems)
Create a newFilterRowComboBoxCellEditor
based on the givenIComboBoxDataProvider
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
commit(SelectionLayer.MoveDirectionEnum direction, boolean closeAfterCommit)
Commits the current value of this editor.NatCombo
createEditorControl(org.eclipse.swt.widgets.Composite parent)
Creates the editor control that is wrapped by this ICellEditor.void
setCanonicalValue(Object canonicalValue)
This implementation overrides the default implementation because of the special handling for comboboxes.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor
activateCell, addNatComboListener, close, getCanonicalValue, getEditorControl, getEditorValue, getIconImage, isFocusOnText, isFreeEdit, isMultiselect, isShowDropdownFilter, isUseCheckbox, select, select, setEditorValue, setFocusOnText, setFreeEdit, setIconImage, setMultiselect, setMultiselectTextBracket, setMultiselectValueSeparator, setShowDropdownFilter, setUseCheckbox
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor
activateAtAnyPosition, activateCell, activateOnTraversal, addEditorControlListeners, calculateControlBounds, commit, commit, getCanonicalValue, getColumnIndex, getColumnPosition, getRowIndex, getRowPosition, handleConversion, isClosed, openAdjacentEditor, openInline, openMultiEditDialog, removeEditorControlListeners, setDataValidator, supportMultiEdit, validateCanonicalValue, validateCanonicalValue
-
-
-
-
Constructor Detail
-
FilterRowComboBoxCellEditor
public FilterRowComboBoxCellEditor(IComboBoxDataProvider dataProvider)
Create a newFilterRowComboBoxCellEditor
based on the givenIComboBoxDataProvider
, showing the default number of items in the dropdown of the combo.- Parameters:
dataProvider
- TheIComboBoxDataProvider
that is responsible for populating the items to the dropdown box.
-
FilterRowComboBoxCellEditor
public FilterRowComboBoxCellEditor(IComboBoxDataProvider dataProvider, int maxVisibleItems)
Create a newFilterRowComboBoxCellEditor
based on the givenIComboBoxDataProvider
.- Parameters:
dataProvider
- TheIComboBoxDataProvider
that is responsible for populating the items to the dropdown box.maxVisibleItems
- The maximum number of items the drop down will show before introducing a scroll bar.
-
-
Method Detail
-
createEditorControl
public NatCombo createEditorControl(org.eclipse.swt.widgets.Composite parent)
Description copied from interface:ICellEditor
Creates the editor control that is wrapped by this ICellEditor. Will use the style configurations in ConfigRegistry for styling the control.- Specified by:
createEditorControl
in interfaceICellEditor
- Overrides:
createEditorControl
in classComboBoxCellEditor
- Parameters:
parent
- The Composite that will be the parent of the new editor control. Can not benull
- Returns:
- The created editor control that is wrapped by this ICellEditor.
-
setCanonicalValue
public void setCanonicalValue(Object canonicalValue)
Description copied from class:ComboBoxCellEditor
This implementation overrides the default implementation because of the special handling for comboboxes. It can handle multi selection and needs to transfer the converted values into a String array so the values in the combobox can be selected.- Specified by:
setCanonicalValue
in interfaceICellEditor
- Overrides:
setCanonicalValue
in classComboBoxCellEditor
- Parameters:
canonicalValue
- The canonical value to be set to the wrapped editor control.
-
commit
public boolean commit(SelectionLayer.MoveDirectionEnum direction, boolean closeAfterCommit)
Description copied from interface:ICellEditor
Commits the current value of this editor. Will first try to convert the current value. Then it is checked if the validation should be executed which can be specified via parameter. If that succeeds and the value can be committed to the data model, the editor will be closed afterwards.- Specified by:
commit
in interfaceICellEditor
- Overrides:
commit
in classAbstractCellEditor
- Parameters:
direction
- The direction the selection within the NatTable should move after commit has finished.closeAfterCommit
- flag to tell whether this editor needs to closed after the commit or if it should stay open.- Returns:
true
if the commit operation succeeded,false
if the current value could not be committed. A value might not be committed for example if the conversion or the validation failed.
-
-