Search in sources :

Example 1 with MultiRowResizeCommand

use of net.sourceforge.nattable.resize.command.MultiRowResizeCommand in project translationstudio8 by heartsome.

the class AutoResizeRowCommandHandler method doCommand.

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 = convertFromSelectionToGrid(rowPositions);
    int[] gridRowHeights = MaxCellBoundsHelper.getPreferedRowHeights(command.getConfigRegistry(), command.getGC(), gridLayer, gridRowPositions);
    gridLayer.doCommand(new MultiRowResizeCommand(gridLayer, gridRowPositions, gridRowHeights));
    targetLayer.doCommand(new TurnViewportOnCommand());
    return true;
}
Also used : TurnViewportOnCommand(net.sourceforge.nattable.print.command.TurnViewportOnCommand) MultiRowResizeCommand(net.sourceforge.nattable.resize.command.MultiRowResizeCommand) TurnViewportOffCommand(net.sourceforge.nattable.print.command.TurnViewportOffCommand)

Example 2 with MultiRowResizeCommand

use of net.sourceforge.nattable.resize.command.MultiRowResizeCommand in project translationstudio8 by heartsome.

the class AutoResizeCurrentRowsCommandHandler method doCommand.

public boolean doCommand(ILayer targetLayer, AutoResizeCurrentRowsCommand command) {
    // Need to resize selected rows even if they are outside the viewport
    targetLayer.doCommand(new TurnViewportOffCommand());
    int[] gridRowPositions = command.getRows();
    int[] gridRowHeights = getPreferedRowHeights(command.getConfigRegistry(), layer, gridRowPositions);
    layer.doCommand(new MultiRowResizeCommand(layer, gridRowPositions, gridRowHeights));
    targetLayer.doCommand(new TurnViewportOnCommand());
    return true;
}
Also used : TurnViewportOnCommand(net.sourceforge.nattable.print.command.TurnViewportOnCommand) MultiRowResizeCommand(net.sourceforge.nattable.resize.command.MultiRowResizeCommand) TurnViewportOffCommand(net.sourceforge.nattable.print.command.TurnViewportOffCommand)

Aggregations

TurnViewportOffCommand (net.sourceforge.nattable.print.command.TurnViewportOffCommand)2 TurnViewportOnCommand (net.sourceforge.nattable.print.command.TurnViewportOnCommand)2 MultiRowResizeCommand (net.sourceforge.nattable.resize.command.MultiRowResizeCommand)2