public class AutoResizeColumnCommandHandler extends Object implements ILayerCommandHandler<AutoResizeColumnsCommand>
InitializeAutoResizeColumnsCommand
.
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 column positions.
|
Constructor and Description |
---|
AutoResizeColumnCommandHandler(GridLayer gridLayer) |
AutoResizeColumnCommandHandler(ILayer commandLayer,
ILayer positionLayer) |
Modifier and Type | Method and Description |
---|---|
protected int[] |
convertFromPositionToCommandLayer(int[] columnPositions)
Translates the column positions the layer stack upwards as the resulting
MultiColumnResizeCommand
will be fired on the command layer which is on top of the position layer. |
boolean |
doCommand(ILayer targetLayer,
AutoResizeColumnsCommand command) |
Class<AutoResizeColumnsCommand> |
getCommandClass() |
protected final ILayer commandLayer
protected final ILayer positionLayer
public AutoResizeColumnCommandHandler(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 column positions.
Needs to be a layer at a lower position in the layer composition.
Typically the body layer stack.public Class<AutoResizeColumnsCommand> getCommandClass()
getCommandClass
in interface ILayerCommandHandler<AutoResizeColumnsCommand>
public boolean doCommand(ILayer targetLayer, AutoResizeColumnsCommand command)
doCommand
in interface ILayerCommandHandler<AutoResizeColumnsCommand>
targetLayer
- the target layercommand
- the commandprotected int[] convertFromPositionToCommandLayer(int[] columnPositions)
MultiColumnResizeCommand
will be fired on the command layer which is on top of the position layer.columnPositions
- The column positions to convert to the positions in the command layerCopyright © 2013. All Rights Reserved.