public class AutoResizeRowCommandHandler extends Object implements ILayerCommandHandler<AutoResizeRowsCommand>
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()
Modifier and Type | Field and Description |
---|---|
protected ILayer |
commandLayer
The layer on which the command should be fired.
|
protected ILayer |
positionLayer
The layer to use for calculation of the row positions.
|
Constructor and Description |
---|
AutoResizeRowCommandHandler(GridLayer gridLayer) |
AutoResizeRowCommandHandler(ILayer commandLayer,
ILayer positionLayer) |
Modifier and Type | Method and Description |
---|---|
protected int[] |
convertFromPositionToCommandLayer(int[] rowPositions)
Translates the row positions the layer stack upwards as the resulting
MultiRowResizeCommand
will be fired on the command layer which is on top of the position layer. |
boolean |
doCommand(ILayer targetLayer,
AutoResizeRowsCommand command) |
Class<AutoResizeRowsCommand> |
getCommandClass() |
protected final ILayer commandLayer
protected final ILayer positionLayer
public AutoResizeRowCommandHandler(ILayer commandLayer, ILayer positionLayer)
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.public Class<AutoResizeRowsCommand> getCommandClass()
getCommandClass
in interface ILayerCommandHandler<AutoResizeRowsCommand>
public boolean doCommand(ILayer targetLayer, AutoResizeRowsCommand command)
doCommand
in interface ILayerCommandHandler<AutoResizeRowsCommand>
targetLayer
- the target layercommand
- the commandprotected int[] convertFromPositionToCommandLayer(int[] rowPositions)
MultiRowResizeCommand
will be fired on the command layer which is on top of the position layer.rowPositions
- The row positions to convert to the positions in the command layerCopyright © 2013. All Rights Reserved.