Class ColumnGroupsCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<IColumnGroupCommand>
org.eclipse.nebula.widgets.nattable.group.performance.command.ColumnGroupsCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<IColumnGroupCommand>
Command handler for handling
IColumnGroupCommand
s to create, remove
and rename column groups.- Since:
- 1.6
-
Constructor Summary
ConstructorDescriptionColumnGroupsCommandHandler
(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer) ColumnGroupsCommandHandler
(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
doCommand
(IColumnGroupCommand command) protected org.eclipse.collections.api.list.primitive.MutableIntList
Return the collection of column positions related to theColumnGroupHeaderLayer.getPositionLayer()
that should be added to a column group.protected boolean
handleCreateColumnGroupCommand
(String columnGroupName) Creates a new column group with the given name out of the currently fully selected column positions.protected void
handleRemoveColumnGroupCommand
(int columnIndex) Remove the column group at the given column index.protected void
Remove the currently fully selected columns from their corresponding groups.Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
-
Constructor Details
-
ColumnGroupsCommandHandler
public ColumnGroupsCommandHandler(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer) - Parameters:
contextLayer
- TheColumnGroupHeaderLayer
this command handler is connected to.selectionLayer
- TheSelectionLayer
needed to get the selection and perform reordering tasks if necessary.
-
ColumnGroupsCommandHandler
public ColumnGroupsCommandHandler(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) - Parameters:
contextLayer
- TheColumnGroupHeaderLayer
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<IColumnGroupCommand>
-
handleCreateColumnGroupCommand
Creates a new column group with the given name out of the currently fully selected column positions. If a selected column is part of an existing group, the existing group will be removed and all columns belonging to that group will be also part of the new group.- Parameters:
columnGroupName
- The name of the new column group.- Returns:
true
if the column group could be created,false
if there are no columns fully selected.
-
handleRemoveColumnGroupCommand
protected void handleRemoveColumnGroupCommand(int columnIndex) Remove the column group at the given column index.- Parameters:
columnIndex
- The column index to retrieve the column group to remove.
-
handleUngroupCommand
protected void handleUngroupCommand()Remove the currently fully selected columns 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 column positions related to theColumnGroupHeaderLayer.getPositionLayer()
that should be added to a column group.The default implementation uses the
SelectionLayer
to retrieve the fully selected column positions.- Returns:
- The collection of column positions related to the
ColumnGroupHeaderLayer.getPositionLayer()
that should be added to a column group. - Since:
- 2.3
-
displayColumnGroupRenameDialog
-
getCommandClass
-