Search in sources :

Example 1 with MultiRowResizeCommand

use of org.eclipse.nebula.widgets.nattable.resize.command.MultiRowResizeCommand in project nebula.widgets.nattable by eclipse.

the class AutoResizeRowCommandHandler method doCommand.

@Override
public boolean doCommand(ILayer targetLayer, AutoResizeRowsCommand command) {
    // Need to resize selected rows even if they are outside the viewport
    targetLayer.doCommand(new TurnViewportOffCommand());
    int[] rowPositions = ObjectUtils.asIntArray(command.getRowPositions());
    int[] gridRowPositions = command.doPositionTransformation() ? convertFromPositionToCommandLayer(rowPositions) : rowPositions;
    int[] gridRowHeights = MaxCellBoundsHelper.getPreferredRowHeights(command.getConfigRegistry(), command.getGCFactory(), this.commandLayer, gridRowPositions);
    this.commandLayer.doCommand(new MultiRowResizeCommand(this.commandLayer, gridRowPositions, gridRowHeights, true));
    targetLayer.doCommand(new TurnViewportOnCommand());
    return true;
}
Also used : TurnViewportOnCommand(org.eclipse.nebula.widgets.nattable.print.command.TurnViewportOnCommand) MultiRowResizeCommand(org.eclipse.nebula.widgets.nattable.resize.command.MultiRowResizeCommand) TurnViewportOffCommand(org.eclipse.nebula.widgets.nattable.print.command.TurnViewportOffCommand)

Aggregations

TurnViewportOffCommand (org.eclipse.nebula.widgets.nattable.print.command.TurnViewportOffCommand)1 TurnViewportOnCommand (org.eclipse.nebula.widgets.nattable.print.command.TurnViewportOnCommand)1 MultiRowResizeCommand (org.eclipse.nebula.widgets.nattable.resize.command.MultiRowResizeCommand)1