Search in sources :

Example 6 with TurnViewportOffCommand

use of net.sourceforge.nattable.print.command.TurnViewportOffCommand 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)

Example 7 with TurnViewportOffCommand

use of net.sourceforge.nattable.print.command.TurnViewportOffCommand 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)7 TurnViewportOnCommand (net.sourceforge.nattable.print.command.TurnViewportOnCommand)7 MultiRowResizeCommand (net.sourceforge.nattable.resize.command.MultiRowResizeCommand)2 ExportToExcelCommand (net.sourceforge.nattable.export.excel.command.ExportToExcelCommand)1 ClientAreaResizeCommand (net.sourceforge.nattable.grid.command.ClientAreaResizeCommand)1 CompositeLayer (net.sourceforge.nattable.layer.CompositeLayer)1 DataLayer (net.sourceforge.nattable.layer.DataLayer)1 PrintCommand (net.sourceforge.nattable.print.command.PrintCommand)1 PrintEntireGridCommand (net.sourceforge.nattable.print.command.PrintEntireGridCommand)1 MultiColumnResizeCommand (net.sourceforge.nattable.resize.command.MultiColumnResizeCommand)1 Rectangle (org.eclipse.swt.graphics.Rectangle)1 ScrollBar (org.eclipse.swt.widgets.ScrollBar)1