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
IColumnGroupCommands to create, remove
and rename column groups.- Since:
- 1.6
-
Constructor Summary
ConstructorsConstructorDescriptionColumnGroupsCommandHandler(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer) ColumnGroupsCommandHandler(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleandoCommand(IColumnGroupCommand command) protected org.eclipse.collections.api.list.primitive.MutableIntListReturn the collection of column positions related to theColumnGroupHeaderLayer.getPositionLayer()that should be added to a column group.protected booleanhandleCreateColumnGroupCommand(String columnGroupName) Creates a new column group with the given name out of the currently fully selected column positions.protected voidhandleRemoveColumnGroupCommand(int columnIndex) Remove the column group at the given column index.protected voidRemove 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- TheColumnGroupHeaderLayerthis command handler is connected to.selectionLayer- TheSelectionLayerneeded to get the selection and perform reordering tasks if necessary.
-
ColumnGroupsCommandHandler
public ColumnGroupsCommandHandler(ColumnGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection) - Parameters:
contextLayer- TheColumnGroupHeaderLayerthis 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<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:
trueif the column group could be created,falseif 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
SelectionLayerto 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
-