Class AutoResizeRowsCommand
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractMultiRowCommand
org.eclipse.nebula.widgets.nattable.resize.command.AutoResizeRowsCommand
- All Implemented Interfaces:
ILayerCommand
Command to trigger auto resizing of rows in a grid.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionAutoResizeRowsCommand(NatTable natTable, boolean transformPositions, int... rowPositions) Create aAutoResizeRowsCommandfor programmatic execution.AutoResizeRowsCommand(NatTable natTable, int... rowPositions) Create aAutoResizeRowsCommandfor programmatic execution.protectedCreate aAutoResizeRowsCommandas a clone of the given command instance.AutoResizeRowsCommand(InitializeAutoResizeRowsCommand initCommand) Create aAutoResizeRowsCommandfrom the givenInitializeAutoResizeRowsCommand. -
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 row positions or not.Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractMultiRowCommand
convertToTargetLayer, getRowPositions, getRowPositionsArray, setRowPositions
-
Constructor Details
-
AutoResizeRowsCommand
Create aAutoResizeRowsCommandfrom the givenInitializeAutoResizeRowsCommand.- Parameters:
initCommand- TheInitializeAutoResizeRowsCommandfrom which this command should be created.
-
AutoResizeRowsCommand
Create aAutoResizeRowsCommandfor programmatic execution.- Parameters:
natTable- TheNatTableinstance in which the resize should be performed.rowPositions- The row positions that should be auto resized, based on the NatTable position.- Since:
- 1.6
-
AutoResizeRowsCommand
Create aAutoResizeRowsCommandfor programmatic execution.- Parameters:
natTable- TheNatTableinstance in which the resize should be performed.transformPositions-trueif the row 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 row positions should be treated based on the NatTable.rowPositions- The row positions that should be auto resized, based on the NatTable position.- Since:
- 1.6
-
AutoResizeRowsCommand
Create aAutoResizeRowsCommandas a clone of the given command instance.- Parameters:
command- TheAutoResizeRowsCommandthat 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 row height calculation.
-
getConfigRegistry
- Returns:
- The
IConfigRegistryneeded for retrieval of style configurations.
-
doPositionTransformation
public boolean doPositionTransformation()Return whether the command handler should transform the row positions or not. If this command is created viaInitializeAutoResizeRowsCommandthe row positions need to be transformed as by default the command handler is registered to the GridLayer but the row 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 row positions,falseif not.- Since:
- 1.6
-