Class EditController

java.lang.Object
org.eclipse.nebula.widgets.nattable.edit.EditController

public class EditController extends Object
Controller to handle the activation of the edit mode of NatTable cells.
  • Method Details

    • editCell

      public static void editCell(ILayerCell cell, org.eclipse.swt.widgets.Composite parent, Object initialCanonicalValue, IConfigRegistry configRegistry)
      Activates the edit mode for the given cell. Will determine whether the editor should be opened inline or in a subdialog.
      Parameters:
      cell - The cell that should be put into the edit mode.
      parent - The parent Composite, needed for the creation of the editor control.
      initialCanonicalValue - The value that should be put to the activated editor control. Usually this value should be the same as calling cell.getDataValue(), but for the special case that an editor should be activated pressing a letter or digit key on the current selection, the initial value should be the Character representing that key.
      configRegistry - The IConfigRegistry containing the configuration of the current NatTable instance the command should be executed for. This is necessary because the edit controllers in the current architecture are not aware of the instance they are running in.
    • editCells

      public static void editCells(Collection<ILayerCell> cells, org.eclipse.swt.widgets.Composite parent, Object initialCanonicalValue, IConfigRegistry configRegistry)
      This method is used to edit cells in a sub dialog. In every case this method will open a dialog for editing, regardless if the list of cells to edit contain several or only one value. Only if the given list of cells to edit is null or empty, there is no action performed.
      Parameters:
      cells - The list of cells to edit.
      parent - The parent composite to access the parent shell, or null to create a top-level shell dialog. In the last case, the dialog will be opened as non modal.
      initialCanonicalValue - The value that should be propagated to the editor control. Needed because for multi cell editing or editor activation by letter/digit key will result in a different value to populate for some editors than populating the value out of the cell/data model directly.
      configRegistry - The IConfigRegistry containing the configuration of the current NatTable instance the command should be executed for. This is necessary because the edit controllers in the current architecture are not aware of the instance they are running in and therefore it is needed for activation of editors.