Class MultiColumnResizeCommand

java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractMultiColumnCommand
org.eclipse.nebula.widgets.nattable.resize.command.MultiColumnResizeCommand
All Implemented Interfaces:
ILayerCommand

public class MultiColumnResizeCommand extends AbstractMultiColumnCommand
Command to trigger resizing of multiple columns.
  • Field Details

  • Constructor Details

    • MultiColumnResizeCommand

      public MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int commonColumnWidth)
      Create a MultiColumnResizeCommand to 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 - The ILayer to 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 a MultiColumnResizeCommand to resize multiple columns, where each column is resized to the same width, e.g. during a drag resize.
      Parameters:
      layer - The ILayer to 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 - true if the commonColumnWidth value should be down scaled according to the scaling level, false if the value should be taken as is.
      Since:
      1.6
    • MultiColumnResizeCommand

      public MultiColumnResizeCommand(ILayer layer, int[] columnPositions, int[] columnWidths)
      Create a MultiColumnResizeCommand to 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 - The ILayer to 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 a MultiColumnResizeCommand to resize multiple columns, where each column can be resized to a different size, e.g. during auto resize.
      Parameters:
      layer - The ILayer to 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 - true if the columnWidths value should be down scaled according to the scaling level, false if the value should be taken as is.
      Since:
      1.6
    • MultiColumnResizeCommand

      protected MultiColumnResizeCommand(MultiColumnResizeCommand command)
      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:
      true if the column width 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)
      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:
      convertToTargetLayer in interface ILayerCommand
      Overrides:
      convertToTargetLayer in class AbstractMultiColumnCommand
      Parameters:
      targetLayer - the target layer
      Returns:
      true if the command is valid after conversion, false if the command is no longer valid.
    • cloneCommand

      public MultiColumnResizeCommand cloneCommand()
      Description copied from interface: ILayerCommand
      Same semantics as Object.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: