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());
}
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);
}
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());
}
Aggregations