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
EditSelectionCommands. 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
ConstructorsConstructorDescriptionEditSelectionCommandHandler(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 TypeMethodDescriptionbooleandoCommand(EditSelectionCommand command) protected Collection<ILayerCell>getCellsForEditing(SelectionLayer selectionLayer, IUniqueIndexLayer upperLayer, IConfigRegistry configRegistry, boolean byTraversal) Retrieve the cells that should be edited.protected booleanhandleOnlyAllSelectedEditable(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- TheSelectionLayerto 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- TheSelectionLayerto retrieve the current selection.upperLayer- The layer on top of the givenSelectionLayerto which the selection should be converted to. Can benullwhich causes the resulting selected cells to be related to theSelectionLayer.- Since:
- 1.6
-
-
Method Details
-
getCommandClass
-
doCommand
- Specified by:
doCommandin classAbstractLayerCommandHandler<EditSelectionCommand>
-
getCellsForEditing
protected Collection<ILayerCell> getCellsForEditing(SelectionLayer selectionLayer, IUniqueIndexLayer upperLayer, IConfigRegistry configRegistry, boolean byTraversal) Retrieve the cells that should be edited.- Parameters:
selectionLayer- TheSelectionLayerto retrieve the current selection.upperLayer- The layer on top of the givenSelectionLayerto which the selection should be converted to. Can benullwhich causes the resulting selected cells to be related to theSelectionLayer.configRegistry- TheIConfigRegistryneeded to access the configuredIEditableRules 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-trueif the activation is triggered by traversal,falseif not.- Returns:
- The selected
ILayerCells 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- TheIConfigRegistryneeded to retrieve the config attribute.- Returns:
trueif multi-edit should only be possible if all selected cells are editable,falseif the non-editable cells should be simply ignored.- Since:
- 2.3
- See Also:
-