Class RowGroupsCommandHandler

java.lang.Object
org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<IRowGroupCommand>
org.eclipse.nebula.widgets.nattable.group.performance.command.RowGroupsCommandHandler
All Implemented Interfaces:
ILayerCommandHandler<IRowGroupCommand>

public class RowGroupsCommandHandler extends AbstractLayerCommandHandler<IRowGroupCommand>
Command handler for handling IRowGroupCommands to create, remove and rename row groups.
Since:
1.6
  • Constructor Details

    • RowGroupsCommandHandler

      public RowGroupsCommandHandler(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer)
      Parameters:
      contextLayer - The RowGroupHeaderLayer this command handler is connected to.
      selectionLayer - The SelectionLayer needed to get the selection and perform reordering tasks if necessary.
    • RowGroupsCommandHandler

      public RowGroupsCommandHandler(RowGroupHeaderLayer contextLayer, SelectionLayer selectionLayer, boolean clearSelection)
      Parameters:
      contextLayer - The RowGroupHeaderLayer this command handler is connected to.
      selectionLayer - The SelectionLayer needed to get the selection and perform reordering tasks if necessary.
      clearSelection - true if the selection should be cleared after group/ungroup, false if the selection should stay unchanged.
      Since:
      2.3
  • Method Details

    • doCommand

      public boolean doCommand(IRowGroupCommand command)
      Specified by:
      doCommand in class AbstractLayerCommandHandler<IRowGroupCommand>
    • handleCreateRowGroupCommand

      protected boolean handleCreateRowGroupCommand(String rowGroupName)
      Creates a new row group with the given name out of the currently fully selected row positions. If a selected row is part of an existing group, the existing group will be removed and all rows belonging to that group will be also part of the new group.
      Parameters:
      rowGroupName - The name of the new row group.
      Returns:
      true if the row group could be created, false if there are no rows fully selected.
    • handleRemoveRowGroupCommand

      protected void handleRemoveRowGroupCommand(int rowIndex)
      Remove the row group at the given row index.
      Parameters:
      rowIndex - The row index to retrieve the row group to remove.
    • handleUngroupCommand

      protected void handleUngroupCommand()
      Remove the currently fully selected rows from their corresponding groups. Will also trigger a reorder to ensure a consistent group rendering
    • getPositionsToProcess

      protected org.eclipse.collections.api.list.primitive.MutableIntList getPositionsToProcess()
      Return the collection of row positions related to the RowGroupHeaderLayer.getPositionLayer() that should be added to a row group.

      The default implementation uses the SelectionLayer to retrieve the fully selected row positions.

      Returns:
      The collection of row positions related to the RowGroupHeaderLayer.getPositionLayer() that should be added to a row group.
      Since:
      2.3
    • displayRowGroupRenameDialog

      protected boolean displayRowGroupRenameDialog(DisplayRowGroupRenameDialogCommand command)
    • getCommandClass

      public Class<IRowGroupCommand> getCommandClass()