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
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:
-
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, useCheckboxFields 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
ConstructorsConstructorDescriptionFilterRowComboBoxCellEditor(IComboBoxDataProvider dataProvider) Create a newFilterRowComboBoxCellEditorbased on the givenIComboBoxDataProvider, showing the default number of items in the dropdown of the combo.FilterRowComboBoxCellEditor(IComboBoxDataProvider dataProvider, int maxVisibleItems) Create a newFilterRowComboBoxCellEditorbased on the givenIComboBoxDataProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRegisters special listeners to theFilterNatComboregarding theEditModeEnum, that are needed to commit/close or change the visibility state of theNatCombodependent on UI interactions.voidclose()Close/dispose the containedControlbooleancommit(SelectionLayer.MoveDirectionEnum direction, boolean closeAfterCommit) Commits the current value of this editor.voidconfigureDropdownFilter(boolean applyFilter, boolean closeOnEnter) This method will activate the usage of the dropdown filter via settingComboBoxCellEditor.setShowDropdownFilter(boolean)totrue.voidconfigureDropdownFilter(boolean applyFilter, boolean closeOnEnter, boolean focusOnDropDownFilter) This method will activate the usage of the dropdown filter via settingComboBoxCellEditor.setShowDropdownFilter(boolean)totrue.createEditorControl(org.eclipse.swt.widgets.Composite parent) Creates the editor control that is wrapped by this ICellEditor.This implementation overrides the default implementation because we can work on the list of canonical items in the combo directly.protected booleanprotected booleanvoidsetCanonicalValue(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, getComboBoxDataProvider, getEditorControl, getEditorValue, getIconImage, isFocusOnDropdownFilter, isFocusOnText, isFreeEdit, isLinkItemAndCheckbox, isMultiselect, isShowDropdownFilter, isUseCheckbox, select, select, setEditorValue, setFocusOnDropdownFilter, setFocusOnText, setFreeEdit, setIconImage, setLinkItemAndCheckbox, setMultiselect, setMultiselectTextBracket, setMultiselectValueSeparator, setShowDropdownFilter, setUseCheckboxMethods 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 Details
-
FilterRowComboBoxCellEditor
Create a newFilterRowComboBoxCellEditorbased on the givenIComboBoxDataProvider, showing the default number of items in the dropdown of the combo.- Parameters:
dataProvider- TheIComboBoxDataProviderthat is responsible for populating the items to the dropdown box.
-
FilterRowComboBoxCellEditor
Create a newFilterRowComboBoxCellEditorbased on the givenIComboBoxDataProvider.- Parameters:
dataProvider- TheIComboBoxDataProviderthat 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 Details
-
createEditorControl
Description copied from interface:ICellEditorCreates the editor control that is wrapped by this ICellEditor. Will use the style configurations in ConfigRegistry for styling the control.- Specified by:
createEditorControlin interfaceICellEditor- Overrides:
createEditorControlin 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.
-
addNatComboListener
Registers special listeners to theFilterNatComboregarding theEditModeEnum, that are needed to commit/close or change the visibility state of theNatCombodependent on UI interactions. Additionally adds special listeners regarding the filter behavior.- Parameters:
combo- TheFilterNatComboto add the listeners to.- Since:
- 2.3
-
close
public void close()Description copied from interface:ICellEditorClose/dispose the containedControl- Specified by:
closein interfaceICellEditor- Overrides:
closein classComboBoxCellEditor
-
setCanonicalValue
Description copied from class:ComboBoxCellEditorThis 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:
setCanonicalValuein interfaceICellEditor- Overrides:
setCanonicalValuein classComboBoxCellEditor- Parameters:
canonicalValue- The canonical value to be set to the wrapped editor control.
-
getCanonicalValue
Description copied from class:ComboBoxCellEditorThis implementation overrides the default implementation because we can work on the list of canonical items in the combo directly. Only for multiselect in combination with free editing, we need to convert here ourself.- Specified by:
getCanonicalValuein interfaceICellEditor- Overrides:
getCanonicalValuein classComboBoxCellEditor- Returns:
- The canonical value after converting the current value or the
value itself if no
IDisplayConverteris configured. - See Also:
-
commit
Description copied from interface:ICellEditorCommits 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:
commitin interfaceICellEditor- Overrides:
commitin 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:
trueif the commit operation succeeded,falseif the current value could not be committed. A value might not be committed for example if the conversion or the validation failed.
-
configureDropdownFilter
public void configureDropdownFilter(boolean applyFilter, boolean closeOnEnter) This method will activate the usage of the dropdown filter via settingComboBoxCellEditor.setShowDropdownFilter(boolean)totrue. Additionally it is possible to configure behavior like whether a filter should be applied to the content on filtering the dropdown or if the editor should be closed on pressing ENTER when having the focus in the dropdown filter control.- Parameters:
applyFilter-trueif on filtering the combobox content, a filter on the list should be applied based on the current visible items,falseif only the dropdown content should be filtered without applying a filter (default).closeOnEnter-trueif the editor should be closed on pressing ENTER when having focus in the combobox filter control,falseif nothing should happen (default).- Since:
- 2.1
- See Also:
-
configureDropdownFilter
public void configureDropdownFilter(boolean applyFilter, boolean closeOnEnter, boolean focusOnDropDownFilter) This method will activate the usage of the dropdown filter via settingComboBoxCellEditor.setShowDropdownFilter(boolean)totrue. Additionally it is possible to configure behavior like whether a filter should be applied to the content on filtering the dropdown or if the editor should be closed on pressing ENTER when having the focus in the dropdown filter control.- Parameters:
applyFilter-trueif on filtering the combobox content, a filter on the list should be applied based on the current visible items,falseif only the dropdown content should be filtered without applying a filter (default).closeOnEnter-trueif the editor should be closed on pressing ENTER when having focus in the combobox filter control,falseif nothing should happen (default).focusOnDropDownFilter-trueif the focus on the activated combobox should be set to the dropdown filter field,falseif the dropdown should get the focus.- Since:
- 2.3
- See Also:
-
isApplyFilterOnDropdownFilter
protected boolean isApplyFilterOnDropdownFilter()- Returns:
trueif on filtering the combobox content, a filter on the list is applied based on the current visible items,falseif only the dropdown content is filtered without applying a filter (default).- Since:
- 2.2
- See Also:
-
isCloseOnEnterInDropdownFilter
protected boolean isCloseOnEnterInDropdownFilter()- Returns:
trueif the editor is closed on pressing ENTER when having focus in the combobox filter control,falseif nothing happens (default).- Since:
- 2.2
- See Also:
-