Class RowGroupsCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<IRowGroupCommand>
org.eclipse.nebula.widgets.nattable.group.performance.command.RowGroupsCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<IRowGroupCommand>
Command handler for handling
IRowGroupCommands to create, remove and
rename row groups.- Since:
- 1.6
-
Constructor Summary
ConstructorsConstructorDescriptionRowGroupsCommandHandler(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer) RowGroupsCommandHandler(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleandoCommand(IRowGroupCommand command) protected org.eclipse.collections.api.list.primitive.MutableIntListReturn the collection of row positions related to theRowGroupHeaderLayer.getPositionLayer()that should be added to a row group.protected booleanhandleCreateRowGroupCommand(String rowGroupName) Creates a new row group with the given name out of the currently fully selected row positions.protected voidhandleRemoveRowGroupCommand(int rowIndex) Remove the row group at the given row index.protected voidRemove the currently fully selected rows from their corresponding groups.Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
Constructor Details
-
RowGroupsCommandHandler
- Parameters:
contextLayer- TheRowGroupHeaderLayerthis command handler is connected to.selectionLayer- TheSelectionLayerneeded to get the selection and perform reordering tasks if necessary.
-
RowGroupsCommandHandler
public RowGroupsCommandHandler(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) - Parameters:
contextLayer- TheRowGroupHeaderLayerthis command handler is connected to.selectionLayer- TheSelectionLayerneeded to get the selection and perform reordering tasks if necessary.clearSelection-trueif the selection should be cleared after group/ungroup,falseif the selection should stay unchanged.- Since:
- 2.3
-
-
Method Details
-
doCommand
- Specified by:
doCommandin classAbstractLayerCommandHandler<IRowGroupCommand>
-
handleCreateRowGroupCommand
Creates a new row group with the given name out of the currently fully selected row positions. If a selected row is part of an existing group, the existing group will be removed and all rows belonging to that group will be also part of the new group.- Parameters:
rowGroupName- The name of the new row group.- Returns:
trueif the row group could be created,falseif there are no rows fully selected.
-
handleRemoveRowGroupCommand
protected void handleRemoveRowGroupCommand(int rowIndex) Remove the row group at the given row index.- Parameters:
rowIndex- The row index to retrieve the row group to remove.
-
handleUngroupCommand
protected void handleUngroupCommand()Remove the currently fully selected rows from their corresponding groups. Will also trigger a reorder to ensure a consistent group rendering -
getPositionsToProcess
protected org.eclipse.collections.api.list.primitive.MutableIntList getPositionsToProcess()Return the collection of row positions related to theRowGroupHeaderLayer.getPositionLayer()that should be added to a row group.The default implementation uses the
SelectionLayerto retrieve the fully selected row positions.- Returns:
- The collection of row positions related to the
RowGroupHeaderLayer.getPositionLayer()that should be added to a row group. - Since:
- 2.3
-
displayRowGroupRenameDialog
-
getCommandClass
-