Search in sources :

Example 1 with IClientAreaProvider

use of net.sourceforge.nattable.util.IClientAreaProvider 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 IClientAreaProvider

use of net.sourceforge.nattable.util.IClientAreaProvider in project translationstudio8 by heartsome.

the class NatTable method internalSetLayer.

private void internalSetLayer(ILayer layer) {
    if (layer != null) {
        this.underlyingLayer = layer;
        underlyingLayer.setClientAreaProvider(new IClientAreaProvider() {

            public Rectangle getClientArea() {
                if (!isDisposed()) {
                    return NatTable.this.getClientArea();
                } else
                    return new Rectangle(0, 0, 0, 0);
            }
        });
        underlyingLayer.addLayerListener(this);
    }
}
Also used : IClientAreaProvider(net.sourceforge.nattable.util.IClientAreaProvider) Rectangle(org.eclipse.swt.graphics.Rectangle)

Example 3 with IClientAreaProvider

use of net.sourceforge.nattable.util.IClientAreaProvider in project translationstudio8 by heartsome.

the class CompositeLayer method setChildLayer.

// Child layer stuff
public void setChildLayer(String regionName, ILayer childLayer, final int layoutX, final int layoutY) {
    if (childLayer == null) {
        throw new IllegalArgumentException("Cannot set null child layer");
    }
    childLayerToRegionNameMap.put(childLayer, regionName);
    childLayer.addLayerListener(this);
    childLayerToLayoutCoordinateMap.put(childLayer, new LayoutCoordinate(layoutX, layoutY));
    childLayerLayout[layoutX][layoutY] = childLayer;
    childLayer.setClientAreaProvider(new IClientAreaProvider() {

        public Rectangle getClientArea() {
            return getChildClientArea(layoutX, layoutY);
        }
    });
}
Also used : IClientAreaProvider(net.sourceforge.nattable.util.IClientAreaProvider) Rectangle(org.eclipse.swt.graphics.Rectangle)

Example 4 with IClientAreaProvider

use of net.sourceforge.nattable.util.IClientAreaProvider 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

IClientAreaProvider (net.sourceforge.nattable.util.IClientAreaProvider)4 Rectangle (org.eclipse.swt.graphics.Rectangle)4 PrintEntireGridCommand (net.sourceforge.nattable.print.command.PrintEntireGridCommand)2