Class EditSelectionCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<EditSelectionCommand>
org.eclipse.nebula.widgets.nattable.edit.command.EditSelectionCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<EditSelectionCommand>
Command handler for handling
EditSelectionCommand
s. Will first check
if all selected cells are editable and if they have the same editor
configured. Will call the EditController
for activation of the edit
mode if these checks succeed.-
Constructor Summary
ConstructorDescriptionEditSelectionCommandHandler
(SelectionLayer selectionLayer) Creates a command handler that performs the edit checks on theSelectionLayer
.EditSelectionCommandHandler
(SelectionLayer selectionLayer, IUniqueIndexLayer upperLayer) Creates a command handler that performs the edit checks based on the given upper layer. -
Method Summary
Modifier and TypeMethodDescriptionboolean
doCommand
(EditSelectionCommand command) protected Collection<ILayerCell>
getCellsForEditing
(SelectionLayer selectionLayer, IUniqueIndexLayer upperLayer, IConfigRegistry configRegistry, boolean byTraversal) Retrieve the cells that should be edited.protected boolean
handleOnlyAllSelectedEditable
(IConfigRegistry configRegistry) Return whether a multi-edit should only be allowed if all selected cells are editable, or if the non-editable cells should be simply ignored.Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
Constructor Details
-
EditSelectionCommandHandler
Creates a command handler that performs the edit checks on theSelectionLayer
.- Parameters:
selectionLayer
- TheSelectionLayer
to retrieve the current selection.
-
EditSelectionCommandHandler
Creates a command handler that performs the edit checks based on the given upper layer. Needed for example if the upper layer adds information that is needed for checks, e.g. a tree layer.- Parameters:
selectionLayer
- TheSelectionLayer
to retrieve the current selection.upperLayer
- The layer on top of the givenSelectionLayer
to which the selection should be converted to. Can benull
which causes the resulting selected cells to be related to theSelectionLayer
.- Since:
- 1.6
-
-
Method Details
-
getCommandClass
-
doCommand
- Specified by:
doCommand
in classAbstractLayerCommandHandler<EditSelectionCommand>
-
getCellsForEditing
protected Collection<ILayerCell> getCellsForEditing(SelectionLayer selectionLayer, IUniqueIndexLayer upperLayer, IConfigRegistry configRegistry, boolean byTraversal) Retrieve the cells that should be edited.- Parameters:
selectionLayer
- TheSelectionLayer
to retrieve the current selection.upperLayer
- The layer on top of the givenSelectionLayer
to which the selection should be converted to. Can benull
which causes the resulting selected cells to be related to theSelectionLayer
.configRegistry
- TheIConfigRegistry
needed to access the configuredIEditableRule
s and the configuration if only editing should only be possible if all selected cells are editable, or if all editable cells that are selected should be used.byTraversal
-true
if the activation is triggered by traversal,false
if not.- Returns:
- The selected
ILayerCell
s that should be edited, related to the given upperLayer. - Since:
- 2.3
-
handleOnlyAllSelectedEditable
Return whether a multi-edit should only be allowed if all selected cells are editable, or if the non-editable cells should be simply ignored.- Parameters:
configRegistry
- TheIConfigRegistry
needed to retrieve the config attribute.- Returns:
true
if multi-edit should only be possible if all selected cells are editable,false
if the non-editable cells should be simply ignored.- Since:
- 2.3
- See Also:
-