Class MultiColumnResizeCommand
java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
org.eclipse.nebula.widgets.nattable.resize.command.MultiColumnResizeCommand
- All Implemented Interfaces:
ILayerCommand
Command to trigger resizing of multiple columns.
-
Field Summary
FieldsFields inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
columnPositionCoordinates -
Constructor Summary
ConstructorsModifierConstructorDescriptionMultiColumnResizeCommand(ILayer layer, int[] columnPositions, int commonColumnWidth) Create aMultiColumnResizeCommandto resize multiple columns, where each column is resized to the same width, e.g.MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int[] columnWidths) Create aMultiColumnResizeCommandto resize multiple columns, where each column can be resized to a different size, e.g.MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int[] columnWidths, boolean downScale) Create aMultiColumnResizeCommandto resize multiple columns, where each column can be resized to a different size, e.g.MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int commonColumnWidth, boolean downScale) Create aMultiColumnResizeCommandto resize multiple columns, where each column is resized to the same width, e.g.protectedConstructor used to clone the given command. -
Method Summary
Modifier and TypeMethodDescriptionSame semantics asObject.clone()Used to make a copies of the command if has to passed to different layer stacks.booleanconvertToTargetLayer(ILayer targetLayer) Convert the column positions to the target layer.booleanintgetColumnWidth(int columnPosition) intMethods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
getColumnPositions, getColumnPositionsArray, setColumnPositions
-
Field Details
-
colPositionToWidth
-
-
Constructor Details
-
MultiColumnResizeCommand
Create aMultiColumnResizeCommandto resize multiple columns, where each column is resized to the same width, e.g. during a drag resize. The given column width will be taken as is without scaling.- Parameters:
layer- TheILayerto which the column positions correlate.columnPositions- The positions of the columns that should be resized.commonColumnWidth- The column width that should be applied to all given columns.
-
MultiColumnResizeCommand
public MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int commonColumnWidth, boolean downScale) Create aMultiColumnResizeCommandto resize multiple columns, where each column is resized to the same width, e.g. during a drag resize.- Parameters:
layer- TheILayerto which the column positions correlate.columnPositions- The positions of the columns that should be resized.commonColumnWidth- The column width that should be applied to all given columns.downScale-trueif the commonColumnWidth value should be down scaled according to the scaling level,falseif the value should be taken as is.- Since:
- 1.6
-
MultiColumnResizeCommand
Create aMultiColumnResizeCommandto resize multiple columns, where each column can be resized to a different size, e.g. during auto resize. The given column width will be taken as is without scaling.- Parameters:
layer- TheILayerto which the column positions correlate.columnPositions- The positions of the columns that should be resized.columnWidths- The new widths that should be applied to the given columns. The indexes in the arrays need to correlate.
-
MultiColumnResizeCommand
public MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int[] columnWidths, boolean downScale) Create aMultiColumnResizeCommandto resize multiple columns, where each column can be resized to a different size, e.g. during auto resize.- Parameters:
layer- TheILayerto which the column positions correlate.columnPositions- The positions of the columns that should be resized.columnWidths- The new widths that should be applied to the given columns. The indexes in the arrays need to correlate.downScale-trueif the columnWidths value should be down scaled according to the scaling level,falseif the value should be taken as is.- Since:
- 1.6
-
MultiColumnResizeCommand
Constructor used to clone the given command.- Parameters:
command- The command to clone.
-
-
Method Details
-
getCommonColumnWidth
public int getCommonColumnWidth()- Returns:
- The common column width if all columns should be resized to the same width, or -1 if the columns should be resized to different values.
-
getColumnWidth
public int getColumnWidth(int columnPosition) - Parameters:
columnPosition- The column position for which the new width is requested.- Returns:
- The new column width for the requested position.
-
downScaleValue
public boolean downScaleValue()- Returns:
trueif the column width value should be down scaled according to the scaling level,falseif the value should be taken as is.- Since:
- 1.6
-
convertToTargetLayer
Convert the column positions to the target layer. Ensure that the width associated with the column is now associated with the converted column position.- Specified by:
convertToTargetLayerin interfaceILayerCommand- Overrides:
convertToTargetLayerin classAbstractMultiColumnCommand- Parameters:
targetLayer- the target layer- Returns:
- true if the command is valid after conversion, false if the command is no longer valid.
-
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:
-