Class 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:
  • Constructor Details

  • Method Details

    • 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 interface ICellEditor
      Overrides:
      createEditorControl in class ComboBoxCellEditor
      Parameters:
      parent - The Composite that will be the parent of the new editor control. Can not be null
      Returns:
      The created editor control that is wrapped by this ICellEditor.
    • addNatComboListener

      protected void addNatComboListener(FilterNatCombo combo)
      Registers special listeners to the FilterNatCombo regarding the EditModeEnum, that are needed to commit/close or change the visibility state of the NatCombo dependent on UI interactions. Additionally adds special listeners regarding the filter behavior.
      Parameters:
      combo - The FilterNatCombo to add the listeners to.
      Since:
      2.3
    • close

      public void close()
      Description copied from interface: ICellEditor
      Close/dispose the contained Control
      Specified by:
      close in interface ICellEditor
      Overrides:
      close in class ComboBoxCellEditor
    • 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 interface ICellEditor
      Overrides:
      setCanonicalValue in class ComboBoxCellEditor
      Parameters:
      canonicalValue - The canonical value to be set to the wrapped editor control.
    • getCanonicalValue

      public Object getCanonicalValue()
      Description copied from class: ComboBoxCellEditor
      This 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:
      getCanonicalValue in interface ICellEditor
      Overrides:
      getCanonicalValue in class ComboBoxCellEditor
      Returns:
      The canonical value after converting the current value or the value itself if no IDisplayConverter is configured.
      See Also:
    • 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 interface ICellEditor
      Overrides:
      commit in class AbstractCellEditor
      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.
    • configureDropdownFilter

      public void configureDropdownFilter(boolean applyFilter, boolean closeOnEnter)
      This method will activate the usage of the dropdown filter via setting ComboBoxCellEditor.setShowDropdownFilter(boolean) to true. 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 - true if on filtering the combobox content, a filter on the list should be applied based on the current visible items, false if only the dropdown content should be filtered without applying a filter (default).
      closeOnEnter - true if the editor should be closed on pressing ENTER when having focus in the combobox filter control, false if 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 setting ComboBoxCellEditor.setShowDropdownFilter(boolean) to true. 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 - true if on filtering the combobox content, a filter on the list should be applied based on the current visible items, false if only the dropdown content should be filtered without applying a filter (default).
      closeOnEnter - true if the editor should be closed on pressing ENTER when having focus in the combobox filter control, false if nothing should happen (default).
      focusOnDropDownFilter - true if the focus on the activated combobox should be set to the dropdown filter field, false if the dropdown should get the focus.
      Since:
      2.3
      See Also:
    • isApplyFilterOnDropdownFilter

      protected boolean isApplyFilterOnDropdownFilter()
      Returns:
      true if on filtering the combobox content, a filter on the list is applied based on the current visible items, false if only the dropdown content is filtered without applying a filter (default).
      Since:
      2.2
      See Also:
    • isCloseOnEnterInDropdownFilter

      protected boolean isCloseOnEnterInDropdownFilter()
      Returns:
      true if the editor is closed on pressing ENTER when having focus in the combobox filter control, false if nothing happens (default).
      Since:
      2.2
      See Also: