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
IRowGroupCommand
s to create, remove and
rename row groups.- Since:
- 1.6
-
Constructor Summary
ConstructorDescriptionRowGroupsCommandHandler
(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer) RowGroupsCommandHandler
(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
doCommand
(IRowGroupCommand command) protected org.eclipse.collections.api.list.primitive.MutableIntList
Return the collection of row positions related to theRowGroupHeaderLayer.getPositionLayer()
that should be added to a row group.protected boolean
handleCreateRowGroupCommand
(String rowGroupName) Creates a new row group with the given name out of the currently fully selected row positions.protected void
handleRemoveRowGroupCommand
(int rowIndex) Remove the row group at the given row index.protected void
Remove 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
- TheRowGroupHeaderLayer
this command handler is connected to.selectionLayer
- TheSelectionLayer
needed to get the selection and perform reordering tasks if necessary.
-
RowGroupsCommandHandler
public RowGroupsCommandHandler(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) - Parameters:
contextLayer
- TheRowGroupHeaderLayer
this command handler is connected to.selectionLayer
- TheSelectionLayer
needed to get the selection and perform reordering tasks if necessary.clearSelection
-true
if the selection should be cleared after group/ungroup,false
if the selection should stay unchanged.- Since:
- 2.3
-
-
Method Details
-
doCommand
- Specified by:
doCommand
in 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:
true
if the row group could be created,false
if 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
SelectionLayer
to 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
-