Search in sources :

Example 1 with PrintEntireGridCommand

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

the class ExportToExcelCommandHandler method setClientAreaToMaximum.

private void setClientAreaToMaximum() {
    final Rectangle maxClientArea = new Rectangle(0, 0, gridLayer.getWidth(), gridLayer.getHeight());
    gridLayer.setClientAreaProvider(new IClientAreaProvider() {

        public Rectangle getClientArea() {
            return maxClientArea;
        }
    });
    gridLayer.doCommand(new PrintEntireGridCommand());
}
Also used : IClientAreaProvider(net.sourceforge.nattable.util.IClientAreaProvider) Rectangle(org.eclipse.swt.graphics.Rectangle) PrintEntireGridCommand(net.sourceforge.nattable.print.command.PrintEntireGridCommand)

Example 2 with PrintEntireGridCommand

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

the class ViewportLayer method doCommand.

@Override
public boolean doCommand(ILayerCommand command) {
    if (command instanceof ClientAreaResizeCommand && command.convertToTargetLayer(this)) {
        ClientAreaResizeCommand clientAreaResizeCommand = (ClientAreaResizeCommand) command;
        ScrollBar hBar = clientAreaResizeCommand.getScrollable().getHorizontalBar();
        ScrollBar vBar = clientAreaResizeCommand.getScrollable().getVerticalBar();
        if (hBarListener == null) {
            hBarListener = new HorizontalScrollBarHandler(this, hBar);
        }
        if (vBarListener == null) {
            vBarListener = new VerticalScrollBarHandler(this, vBar);
        }
        handleGridResize();
        return true;
    } else if (command instanceof TurnViewportOffCommand) {
        viewportOffOriginCol = localToUnderlyingColumnPosition(0);
        viewportOnOriginRow = localToUnderlyingRowPosition(0);
        viewportOff = true;
        return true;
    } else if (command instanceof TurnViewportOnCommand) {
        viewportOff = false;
        setOriginColumnPosition(viewportOffOriginCol);
        setOriginRowPosition(viewportOnOriginRow);
        return true;
    } else if (command instanceof PrintEntireGridCommand) {
        moveCellPositionIntoViewport(0, 0, false);
    }
    return super.doCommand(command);
}
Also used : TurnViewportOnCommand(net.sourceforge.nattable.print.command.TurnViewportOnCommand) ClientAreaResizeCommand(net.sourceforge.nattable.grid.command.ClientAreaResizeCommand) TurnViewportOffCommand(net.sourceforge.nattable.print.command.TurnViewportOffCommand) ScrollBar(org.eclipse.swt.widgets.ScrollBar) PrintEntireGridCommand(net.sourceforge.nattable.print.command.PrintEntireGridCommand)

Example 3 with PrintEntireGridCommand

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

the class GridLayerPrinter method setGridLayerSize.

/**
	 * Expand the client area of the grid such that
	 * all the contents fit in the viewport. This ensures that when the grid prints
	 * we print the <i>entire</i> table.
	 * @param printer
	 */
private void setGridLayerSize(PrinterData printerData) {
    if (printerData.scope == PrinterData.SELECTION) {
        gridLayer.setClientAreaProvider(originalClientAreaProvider);
        return;
    }
    final Rectangle fullGridSize = getTotalGridArea();
    gridLayer.setClientAreaProvider(new IClientAreaProvider() {

        public Rectangle getClientArea() {
            return fullGridSize;
        }
    });
    gridLayer.doCommand(new PrintEntireGridCommand());
}
Also used : IClientAreaProvider(net.sourceforge.nattable.util.IClientAreaProvider) Rectangle(org.eclipse.swt.graphics.Rectangle) PrintEntireGridCommand(net.sourceforge.nattable.print.command.PrintEntireGridCommand)

Aggregations

PrintEntireGridCommand (net.sourceforge.nattable.print.command.PrintEntireGridCommand)3 IClientAreaProvider (net.sourceforge.nattable.util.IClientAreaProvider)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2 ClientAreaResizeCommand (net.sourceforge.nattable.grid.command.ClientAreaResizeCommand)1 TurnViewportOffCommand (net.sourceforge.nattable.print.command.TurnViewportOffCommand)1 TurnViewportOnCommand (net.sourceforge.nattable.print.command.TurnViewportOnCommand)1 ScrollBar (org.eclipse.swt.widgets.ScrollBar)1