Class MultiRowResizeCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.command.AbstractMultiRowCommand
-
- org.eclipse.nebula.widgets.nattable.resize.command.MultiRowResizeCommand
-
- All Implemented Interfaces:
ILayerCommand
public class MultiRowResizeCommand extends AbstractMultiRowCommand
Command to trigger resizing of multiple rows.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<RowPositionCoordinate,Integer>
rowPositionToHeight
-
Constructor Summary
Constructors Modifier Constructor Description MultiRowResizeCommand(ILayer layer, int[] rowPositions, int commonRowHeight)
Create aMultiRowResizeCommand
to resize multiple rows, where each row is resized to the same height, e.g.MultiRowResizeCommand(ILayer layer, int[] rowPositions, int[] rowHeights)
Create aMultiRowResizeCommand
to resize multiple rows, where each row can be resized to a different size, e.g.MultiRowResizeCommand(ILayer layer, int[] rowPositions, int[] rowHeights, boolean downScale)
Create aMultiRowResizeCommand
to resize multiple rows, where each row can be resized to a different size, e.g.MultiRowResizeCommand(ILayer layer, int[] rowPositions, int commonRowHeight, boolean downScale)
Create aMultiRowResizeCommand
to resize multiple rows, where each row is resized to the same height, e.g.protected
MultiRowResizeCommand(MultiRowResizeCommand command)
Constructor used to clone the given command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiRowResizeCommand
cloneCommand()
Same semantics asObject.clone()
Used to make a copies of the command if has to passed to different layer stacks.boolean
convertToTargetLayer(ILayer targetLayer)
Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer.boolean
downScaleValue()
int
getCommonRowHeight()
int
getRowHeight(int rowPosition)
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractMultiRowCommand
getRowPositions, getRowPositionsArray, setRowPositions
-
-
-
-
Field Detail
-
rowPositionToHeight
protected Map<RowPositionCoordinate,Integer> rowPositionToHeight
-
-
Constructor Detail
-
MultiRowResizeCommand
public MultiRowResizeCommand(ILayer layer, int[] rowPositions, int commonRowHeight)
Create aMultiRowResizeCommand
to resize multiple rows, where each row is resized to the same height, e.g. during a drag resize. The given row height will be taken as is without scaling.- Parameters:
layer
- TheILayer
to which the row positions correlate.rowPositions
- The positions of the rows that should be resized.commonRowHeight
- The row height that should be applied to all given rows.
-
MultiRowResizeCommand
public MultiRowResizeCommand(ILayer layer, int[] rowPositions, int commonRowHeight, boolean downScale)
Create aMultiRowResizeCommand
to resize multiple rows, where each row is resized to the same height, e.g. during a drag resize.- Parameters:
layer
- TheILayer
to which the row positions correlate.rowPositions
- The positions of the rows that should be resized.commonRowHeight
- The row height that should be applied to all given rows.downScale
-true
if the commonRowHeight value should be down scaled according to the scaling level,false
if the value should be taken as is.- Since:
- 1.6
-
MultiRowResizeCommand
public MultiRowResizeCommand(ILayer layer, int[] rowPositions, int[] rowHeights)
Create aMultiRowResizeCommand
to resize multiple rows, where each row can be resized to a different size, e.g. during auto resize. The given row heights will be taken as is without scaling.- Parameters:
layer
- TheILayer
to which the row positions correlate.rowPositions
- The positions of the rows that should be resized.rowHeights
- The new heights that should be applied to the given rows. The indexes in the arrays need to correlate.
-
MultiRowResizeCommand
public MultiRowResizeCommand(ILayer layer, int[] rowPositions, int[] rowHeights, boolean downScale)
Create aMultiRowResizeCommand
to resize multiple rows, where each row can be resized to a different size, e.g. during auto resize.- Parameters:
layer
- TheILayer
to which the row positions correlate.rowPositions
- The positions of the rows that should be resized.rowHeights
- The new heights that should be applied to the given rows. The indexes in the arrays need to correlate.downScale
-true
if the rowHeights values should be down scaled according to the scaling level,false
if the value should be taken as is.- Since:
- 1.6
-
MultiRowResizeCommand
protected MultiRowResizeCommand(MultiRowResizeCommand command)
Constructor used to clone the given command.- Parameters:
command
- The command to clone.
-
-
Method Detail
-
getCommonRowHeight
public int getCommonRowHeight()
- Returns:
- The common row height if all rows should be resized to the same height, or -1 if the rows should be resized to different values.
-
getRowHeight
public int getRowHeight(int rowPosition)
- Parameters:
rowPosition
- The row position for which the new height is requested.- Returns:
- The new row height for the requested position.
-
downScaleValue
public boolean downScaleValue()
- Returns:
true
if the row height value should be down scaled according to the scaling level,false
if the value should be taken as is.- Since:
- 1.6
-
convertToTargetLayer
public boolean convertToTargetLayer(ILayer targetLayer)
Description copied from interface:ILayerCommand
Convert the row/column coordinates the command might be carrying from the source layer to the destination (target) layer. If it is not possible to convert the command to the target layer, then this method will return false and the state of this command object will remain unchanged. Note: Commands should not be processed if they fail conversion.- Specified by:
convertToTargetLayer
in interfaceILayerCommand
- Overrides:
convertToTargetLayer
in classAbstractMultiRowCommand
- Parameters:
targetLayer
- the target layer- Returns:
- true if the command is valid after conversion, false if the command is no longer valid.
-
cloneCommand
public MultiRowResizeCommand cloneCommand()
Description copied from interface:ILayerCommand
Same 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:
GridLayer.doCommand(ILayerCommand)
-
-