Search in sources :

Example 6 with TurnViewportOnCommand

use of net.sourceforge.nattable.print.command.TurnViewportOnCommand in project translationstudio8 by heartsome.

the class GridLayerPrinter method restoreGridLayerState.

private void restoreGridLayerState() {
    gridLayer.setClientAreaProvider(originalClientAreaProvider);
    gridLayer.doCommand(new TurnViewportOnCommand());
}
Also used : TurnViewportOnCommand(net.sourceforge.nattable.print.command.TurnViewportOnCommand)

Example 7 with TurnViewportOnCommand

use of net.sourceforge.nattable.print.command.TurnViewportOnCommand in project translationstudio8 by heartsome.

the class PrintAction method run.

public void run(NatTable natTable, KeyEvent event) {
    natTable.doCommand(new TurnViewportOffCommand());
    natTable.doCommand(new PrintCommand(natTable.getConfigRegistry(), natTable.getShell()));
    natTable.doCommand(new TurnViewportOnCommand());
}
Also used : TurnViewportOnCommand(net.sourceforge.nattable.print.command.TurnViewportOnCommand) PrintCommand(net.sourceforge.nattable.print.command.PrintCommand) TurnViewportOffCommand(net.sourceforge.nattable.print.command.TurnViewportOffCommand)

Example 8 with TurnViewportOnCommand

use of net.sourceforge.nattable.print.command.TurnViewportOnCommand 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 9 with TurnViewportOnCommand

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

TurnViewportOnCommand (net.sourceforge.nattable.print.command.TurnViewportOnCommand)9 TurnViewportOffCommand (net.sourceforge.nattable.print.command.TurnViewportOffCommand)7 MultiRowResizeCommand (net.sourceforge.nattable.resize.command.MultiRowResizeCommand)2 IOException (java.io.IOException)1 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 LayerCell (net.sourceforge.nattable.layer.cell.LayerCell)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