Class AutoResizeRowCommandHandler
java.lang.Object
org.eclipse.nebula.widgets.nattable.grid.command.AutoResizeRowCommandHandler
- All Implemented Interfaces:
ILayerCommandHandler<AutoResizeRowsCommand>
public class AutoResizeRowCommandHandler
extends Object
implements ILayerCommandHandler<AutoResizeRowsCommand>
This command is triggered by the
InitializeAutoResizeRowsCommand
. The
selected columns picked from the SelectionLayer
by the above command.
This handler runs as a second step.
This handler assumes that the target layer is the NatTable itself on calling doCommand()
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAutoResizeRowCommandHandler
(GridLayer gridLayer) AutoResizeRowCommandHandler
(ILayer commandLayer, ILayer positionLayer) -
Method Summary
Modifier and TypeMethodDescriptionprotected int[]
convertFromPositionToCommandLayer
(int[] rowPositions) Translates the row positions the layer stack upwards as the resultingMultiRowResizeCommand
will be fired on the command layer which is on top of the position layer.boolean
doCommand
(ILayer targetLayer, AutoResizeRowsCommand command)
-
Field Details
-
commandLayer
The layer on which the command should be fired. Usually this will be the GridLayer -
positionLayer
The layer to use for calculation of the row positions. Needs to be a layer at a lower position in the layer composition. Typically the body layer stack.
-
-
Constructor Details
-
AutoResizeRowCommandHandler
- Parameters:
commandLayer
- The layer on which the command should be fired. Usually this will be the GridLayer.positionLayer
- The layer to use for calculation of the row positions. Needs to be a layer at a lower position in the layer composition. Typically the body layer stack.
-
AutoResizeRowCommandHandler
- Parameters:
gridLayer
- TheGridLayer
to which this command handler should be registered
-
-
Method Details
-
getCommandClass
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<AutoResizeRowsCommand>
-
doCommand
- Specified by:
doCommand
in interfaceILayerCommandHandler<AutoResizeRowsCommand>
- Parameters:
targetLayer
- the target layercommand
- the command- Returns:
- true if the command has been handled, false otherwise
-
convertFromPositionToCommandLayer
protected int[] convertFromPositionToCommandLayer(int[] rowPositions) Translates the row positions the layer stack upwards as the resultingMultiRowResizeCommand
will be fired on the command layer which is on top of the position layer.- Parameters:
rowPositions
- The row positions to convert to the positions in the command layer- Returns:
- The translated row positions for the local command layer.
-