Search in sources :

Example 1 with MultiColumnResizeCommand

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

the class AutoResizeColumnCommandHandler method doCommand.

public boolean doCommand(ILayer targetLayer, AutoResizeColumnsCommand command) {
    // Need to resize selected columns even if they are outside the viewport
    targetLayer.doCommand(new TurnViewportOffCommand());
    int[] columnPositions = ObjectUtils.asIntArray(command.getColumnPositions());
    int[] gridColumnPositions = convertFromSelectionToGrid(columnPositions);
    int[] gridColumnWidths = MaxCellBoundsHelper.getPreferedColumnWidths(command.getConfigRegistry(), command.getGC(), gridLayer, gridColumnPositions);
    gridLayer.doCommand(new MultiColumnResizeCommand(gridLayer, gridColumnPositions, gridColumnWidths));
    targetLayer.doCommand(new TurnViewportOnCommand());
    return true;
}
Also used : TurnViewportOnCommand(net.sourceforge.nattable.print.command.TurnViewportOnCommand) MultiColumnResizeCommand(net.sourceforge.nattable.resize.command.MultiColumnResizeCommand) TurnViewportOffCommand(net.sourceforge.nattable.print.command.TurnViewportOffCommand)

Aggregations

TurnViewportOffCommand (net.sourceforge.nattable.print.command.TurnViewportOffCommand)1 TurnViewportOnCommand (net.sourceforge.nattable.print.command.TurnViewportOnCommand)1 MultiColumnResizeCommand (net.sourceforge.nattable.resize.command.MultiColumnResizeCommand)1