Class AutoResizeColumnsCommand
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
org.eclipse.nebula.widgets.nattable.resize.command.AutoResizeColumnsCommand
- All Implemented Interfaces:
ILayerCommand
Command indicating that all selected columns have to be auto resized i.e made
wide enough to just fit the widest cell. This should also take the column
header into account
Note: The
InitializeAutoResizeColumnsCommand has to be fired first
when autoresizing columns.-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
columnPositionCoordinates -
Constructor Summary
ConstructorsModifierConstructorDescriptionAutoResizeColumnsCommand(NatTable natTable, boolean transformPositions, int... columnPositions) Create aAutoResizeColumnsCommandfor programmatic execution.AutoResizeColumnsCommand(NatTable natTable, int... columnPositions) Create aAutoResizeColumnsCommandfor programmatic execution.protectedCreate aAutoResizeColumnsCommandas a clone of the given command instance.Create aAutoResizeColumnsCommandfrom the givenInitializeAutoResizeColumnsCommand. -
Method Summary
Modifier and TypeMethodDescriptionSame semantics asObject.clone()Used to make a copies of the command if has to passed to different layer stacks.booleanReturn whether the command handler should transform the column positions or not.Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
convertToTargetLayer, getColumnPositions, getColumnPositionsArray, setColumnPositions
-
Constructor Details
-
AutoResizeColumnsCommand
Create aAutoResizeColumnsCommandfrom the givenInitializeAutoResizeColumnsCommand.- Parameters:
initCommand- TheInitializeAutoResizeColumnsCommandfrom which this command should be created.
-
AutoResizeColumnsCommand
Create aAutoResizeColumnsCommandfor programmatic execution.- Parameters:
natTable- TheNatTableinstance in which the resize should be performed.columnPositions- The column positions that should be auto resized, based on the NatTable position.- Since:
- 1.6
-
AutoResizeColumnsCommand
public AutoResizeColumnsCommand(NatTable natTable, boolean transformPositions, int... columnPositions) Create aAutoResizeColumnsCommandfor programmatic execution.- Parameters:
natTable- TheNatTableinstance in which the resize should be performed.transformPositions-trueif the column positions should be back transformed (e.g. in case the positions are collected via SelectionLayer and therefore need to be back transformed to the GridLayer coordinates),falseif the column positions should be treated based on the NatTable.columnPositions- The column positions that should be auto resized, based on the NatTable position.- Since:
- 1.6
-
AutoResizeColumnsCommand
Create aAutoResizeColumnsCommandas a clone of the given command instance.- Parameters:
command- TheAutoResizeColumnsCommandthat should be cloned.
-
-
Method Details
-
cloneCommand
Description copied from interface:ILayerCommandSame semantics asObject.clone()Used to make a copies of the command if has to passed to different layer stacks.- Returns:
- a cloned instance of the command
- See Also:
-
getGCFactory
- Returns:
- The
GCFactoryneeded to create a temporary GC for column height calculation.
-
getConfigRegistry
- Returns:
- The
IConfigRegistryneeded for retrieval of style configurations.
-
doPositionTransformation
public boolean doPositionTransformation()Return whether the command handler should transform the column positions or not. If this command is created viaInitializeAutoResizeColumnsCommandthe column positions need to be transformed as by default the command handler is registered to the GridLayer but the column positions are set based on the SelectionLayer. A back transformation is therefore needed. If this command was not created with the other constructor, a back transformation in the command handler is not necessary.- Returns:
trueif the command handler should transform the column positions,falseif not.- Since:
- 1.6
-