java.lang.Object
org.eclipse.nebula.widgets.nattable.group.performance.command.RowGroupReorderCommand
All Implemented Interfaces:
ILayerCommand

public class RowGroupReorderCommand extends Object implements ILayerCommand
Command to trigger reordering of a row group.

The command does not inherit the RowReorderCommand as then it would be consumed first by the RowReorderLayer in the body layer stack and would not come to the row header layer stack.

Since:
1.6
  • Constructor Details

    • RowGroupReorderCommand

      public RowGroupReorderCommand(ILayer layer, int level, int fromRowPosition, int toRowPosition)
      Parameters:
      layer - The layer to which the positions match.
      level - The group level on which the group reorder should be performed.
      fromRowPosition - The row position of the group that should be reordered.
      toRowPosition - The row position to which the reorder should be performed.
    • RowGroupReorderCommand

      public RowGroupReorderCommand(ILayer layer, int level, int fromRowPosition, int toRowPosition, boolean performConversion)
      Parameters:
      layer - The layer to which the positions match.
      level - The group level on which the group reorder should be performed.
      fromRowPosition - The row position of the group that should be reordered.
      toRowPosition - The row position to which the reorder should be performed.
      performConversion - Configure whether a position conversion should be performed or not. If this value is set to false convertToTargetLayer(ILayer) does not perform any logic and will always return true. In that case layer has to be the positionLayer of the ColumnGroupHeaderLayer, typically the SelectionLayer. Otherwise this command will not work correctly.
    • RowGroupReorderCommand

      protected RowGroupReorderCommand(RowGroupReorderCommand command)
      Clone constructor.
      Parameters:
      command - The command to clone.
  • Method Details

    • getLevel

      public int getLevel()
      Returns:
      The group level on which the group reorder should be performed.
    • getFromRowPosition

      public int getFromRowPosition()
      Returns:
      The row position of the group that should be reordered.
    • getToRowPosition

      public int getToRowPosition()
      Returns:
      The row position to which the reorder should be performed.
    • isReorderToTopEdge

      public boolean isReorderToTopEdge()
      Returns:
      true if the reorder should be performed to the top edge of the to position, false if the reorder should happen to the bottom edge, e.g. on reordering to the end of the table.
    • 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 interface ILayerCommand
      Parameters:
      targetLayer - the target layer
      Returns:
      true if the command is valid after conversion, false if the command is no longer valid.
    • cloneCommand

      public RowGroupReorderCommand 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.
      Specified by:
      cloneCommand in interface ILayerCommand
      Returns:
      a cloned instance of the command
      See Also: