Class AutoResizeColumnCommandHandler
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.grid.command.AutoResizeColumnCommandHandler
-
- All Implemented Interfaces:
ILayerCommandHandler<AutoResizeColumnsCommand>
public class AutoResizeColumnCommandHandler extends Object implements ILayerCommandHandler<AutoResizeColumnsCommand>
This command is triggered by theInitializeAutoResizeColumnsCommand
. The selected columns picked from theSelectionLayer
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
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description AutoResizeColumnCommandHandler(GridLayer gridLayer)
AutoResizeColumnCommandHandler(ILayer commandLayer, ILayer positionLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int[]
convertFromPositionToCommandLayer(int[] columnPositions)
Translates the column positions the layer stack upwards as the resultingMultiColumnResizeCommand
will be fired on the command layer which is on top of the position layer.boolean
doCommand(ILayer targetLayer, AutoResizeColumnsCommand command)
Class<AutoResizeColumnsCommand>
getCommandClass()
-
-
-
Field Detail
-
commandLayer
protected final ILayer commandLayer
The layer on which the command should be fired. Usually this will be the GridLayer
-
positionLayer
protected final ILayer 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.
-
-
Constructor Detail
-
AutoResizeColumnCommandHandler
public AutoResizeColumnCommandHandler(ILayer commandLayer, ILayer positionLayer)
- 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 column positions. Needs to be a layer at a lower position in the layer composition. Typically the body layer stack.
-
-
Method Detail
-
getCommandClass
public Class<AutoResizeColumnsCommand> getCommandClass()
- Specified by:
getCommandClass
in interfaceILayerCommandHandler<AutoResizeColumnsCommand>
-
doCommand
public boolean doCommand(ILayer targetLayer, AutoResizeColumnsCommand command)
- Specified by:
doCommand
in interfaceILayerCommandHandler<AutoResizeColumnsCommand>
- Parameters:
targetLayer
- the target layercommand
- the command- Returns:
- true if the command has been handled, false otherwise
-
convertFromPositionToCommandLayer
protected int[] convertFromPositionToCommandLayer(int[] columnPositions)
Translates the column positions the layer stack upwards as the resultingMultiColumnResizeCommand
will be fired on the command layer which is on top of the position layer.- Parameters:
columnPositions
- The column positions to convert to the positions in the command layer- Returns:
- The translated column positions for the local command layer.
-
-