Class ColumnGroupReorderLayer

All Implemented Interfaces:
ILayer, ILayerListener, IUniqueIndexLayer, IPersistable

public class ColumnGroupReorderLayer extends AbstractLayerTransform implements IUniqueIndexLayer
Adds functionality allowing the reordering of the the column groups.
  • Constructor Details

  • Method Details

    • reorderColumnGroup

      public boolean reorderColumnGroup(int fromColumnPosition, int toColumnPosition)
      Parameters:
      fromColumnPosition - The column position of a column in the column group that should be reordered.
      toColumnPosition - The column position to which a column group should be reordered to.
      Returns:
      true if the reorder command was executed and consumed successfully
    • getModel

      public ColumnGroupModel getModel()
      Returns:
      The ColumnGroupModel that is used to specify the column groups.
    • getUnderlyingLayer

      public IUniqueIndexLayer getUnderlyingLayer()
      Overrides:
      getUnderlyingLayer in class AbstractLayerTransform
      Since:
      1.3
    • registerCommandHandlers

      protected void registerCommandHandlers()
      Description copied from class: AbstractLayer
      Layers should use this method to register their command handlers and call it from their constructor. This allows easy overriding if required of command handlers
      Overrides:
      registerCommandHandlers in class AbstractLayer
    • getColumnPositionByIndex

      public int getColumnPositionByIndex(int columnIndex)
      Specified by:
      getColumnPositionByIndex in interface IUniqueIndexLayer
    • getRowPositionByIndex

      public int getRowPositionByIndex(int rowIndex)
      Specified by:
      getRowPositionByIndex in interface IUniqueIndexLayer
    • getColumnGroupPositions

      public List<Integer> getColumnGroupPositions(int fromColumnIndex)
      Parameters:
      fromColumnIndex - The column index of a column that is part of a column group.
      Returns:
      The column positions for all the columns in the column group specified by the given index.
    • getReorderFromColumnPosition

      public int getReorderFromColumnPosition()
      Used to support column reordering via drag and drop.
      Returns:
      The position from which a column reorder operation was started from.
    • setReorderFromColumnPosition

      public void setReorderFromColumnPosition(int fromColumnPosition)
      Used to support column reordering via drag and drop.
      Parameters:
      fromColumnPosition - The position from which a column reorder operation was started from.
    • updateColumnGroupModel

      public boolean updateColumnGroupModel(List<Integer> fromColumnPositions, int toColumnPosition, boolean reorderToLeftEdge)
      Updates the ColumnGroupModel with respect to a column reordering operation.
      Parameters:
      fromColumnPositions - The column positions that should be reordered.
      toColumnPosition - The column position to which a column should be reordered.
      reorderToLeftEdge - Whether the toPosition should be calculated for attachment to the left or not.
      Returns:
      true if only a ColumnGroupModel modification was triggered and no column reordering is necessary, false if additionally a column reordering needs to be performed.
      Since:
      1.3
    • updateColumnGroupModel

      public boolean updateColumnGroupModel(int fromColumnPosition, int toColumnPosition, boolean reorderToLeftEdge)
      Updates the ColumnGroupModel with respect to a column reordering operation.
      Parameters:
      fromColumnPosition - The column position that should be reordered.
      toColumnPosition - The column position to which a column should be reordered.
      reorderToLeftEdge - Whether the toPosition should be calculated for attachment to the left or not.
      Returns:
      true if only a ColumnGroupModel modification was triggered and no column reordering is necessary, false if additionally a column reordering needs to be performed.
      Since:
      1.3
    • getColumnIndexesForPositions

      protected int[] getColumnIndexesForPositions(List<Integer> fromColumnPositions)
      Transforms the given collection of column positions to an array of column indexes.
      Parameters:
      fromColumnPositions - The column positions to transform.
      Returns:
      An array that contains the indexes for the given positions.
      Since:
      1.3
    • updateColumnGroupModel

      public boolean updateColumnGroupModel(int fromColumnPosition, int toColumnPosition, boolean reorderToLeftEdge, List<Integer> fromColumnPositions)
      Updates the ColumnGroupModel with respect to a column reordering operation.
      Parameters:
      fromColumnPosition - The column position that should be used for determining the necessary operation.
      toColumnPosition - The column position to which a column should be reordered.
      reorderToLeftEdge - Whether the toPosition should be calculated for attachment to the left or not.
      fromColumnPositions - The column positions that should be reordered.
      Returns:
      true if only a ColumnGroupModel modification was triggered and no column reordering is necessary, false if additionally a column reordering needs to be performed.
      Since:
      1.3