Examples of DummyGridLayerStack


Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

        StandaloneNatExampleRunner
                .run(new ZoomedViewportSelectionDataLayerExample());
    }

    public Control createExampleControl(Composite parent) {
        ZoomLayer zoomLayer = new ZoomLayer(new DummyGridLayerStack());
        zoomLayer.setZoomFactor(3.0f);
        return new NatTable(parent, zoomLayer);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

        natTable.configure();
        return natTable;
    }

    private NatTable setup(Composite parent) {
        DummyGridLayerStack gridLayer = new DummyGridLayerStack();
        final NatTable natTable = new NatTable(parent, gridLayer, false);
        DataLayer bodyDataLayer = (DataLayer) gridLayer.getBodyDataLayer();

        // Add an AggregrateConfigLabelAccumulator - we can add other
        // accumulators to this as required
        AggregrateConfigLabelAccumulator aggregrateConfigLabelAccumulator = new AggregrateConfigLabelAccumulator();
        bodyDataLayer
                .setConfigLabelAccumulator(aggregrateConfigLabelAccumulator);

        ColumnOverrideLabelAccumulator columnLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);
        ColumnOverrideLabelAccumulator bodyLabelAccumulator = new ColumnOverrideLabelAccumulator(
                bodyDataLayer);

        aggregrateConfigLabelAccumulator.add(columnLabelAccumulator);
        aggregrateConfigLabelAccumulator.add(bodyLabelAccumulator);

        // Add a label for the highlighted column
        // We will add a style for this label to the config registry in a bit
        bodyLabelAccumulator.registerColumnOverrides(2, BODY_LABEL_1);
        columnLabelAccumulator.registerColumnOverrides(2, COLUMN_LABEL_1);

        // Register a command handler for the StyleEditorDialog
        DisplayColumnStyleEditorCommandHandler styleChooserCommandHandler = new DisplayColumnStyleEditorCommandHandler(
                gridLayer.getBodyLayer().getSelectionLayer(),
                columnLabelAccumulator, natTable.getConfigRegistry());

        DefaultBodyLayerStack bodyLayer = gridLayer.getBodyLayer();
        bodyLayer.registerCommandHandler(styleChooserCommandHandler);

        // Register the style editor as persistable
        // This will persist the style applied to the columns when
        // NatTable#saveState is invoked
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    public static void main(String[] args) throws Exception {
        StandaloneNatExampleRunner.run(new Tooltips());
    }

    public Control createExampleControl(Composite parent) {
        NatTable natTable = new NatTable(parent, new DummyGridLayerStack(20,
                100));
        attachToolTip(natTable);
        return natTable;
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

        return "NatTable is designed to support very large data sets. This example shows a table with 500 columns and 1,000,000 rows. "
                + "NatTable tries hard to only ask for and render data that it currently needs to display.";
    }

    public Control createExampleControl(Composite parent) {
        DummyGridLayerStack layer = new DummyGridLayerStack(500, 1000000);

        // Widen row header so that all the row numbers are visible
        DataLayer rowHeaderDataLayer = (DataLayer) layer
                .getRowHeaderDataLayer();
        rowHeaderDataLayer.setColumnWidthByPosition(0, 80);

        return new NatTable(parent, layer);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    public NatTable(Composite parent, ILayer layer, boolean autoconfigure) {
        this(parent, DEFAULT_STYLE_OPTIONS, layer, autoconfigure);
    }

    public NatTable(Composite parent, final int style) {
        this(parent, style, new DummyGridLayerStack());
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    public NatTable(Composite parent, final int style) {
        this(parent, style, new DummyGridLayerStack());
    }

    public NatTable(Composite parent, final int style, boolean autoconfigure) {
        this(parent, style, new DummyGridLayerStack(), autoconfigure);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

        GridDataFactory.fillDefaults().grab(true, true).applyTo(mix);

        // example for percentage calculation with default sizing in a grid
        // all columns will be same size while the NatTable itself will have
        // 100%
        DummyGridLayerStack gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer n4DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n4DataLayer.setColumnPercentageSizing(true);
        n4DataLayer.setRowPercentageSizing(true);
        final NatTable n4 = new NatTable(gridPanel, gridLayer, false);
        n4.addConfiguration(new DefaultNatTableStyleConfiguration());
        n4.addConfiguration(new HeaderMenuConfiguration(n4));
        n4.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n4);

        // example for fixed percentage sizing in a grid
        // ensure that the sum of column sizes is not greater than 100
        gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer n5DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n5DataLayer.setColumnWidthByPosition(0, 25);
        n5DataLayer.setColumnWidthByPosition(1, 25);
        n5DataLayer.setColumnWidthByPosition(2, 50);
        n5DataLayer.setColumnPercentageSizing(true);
        final NatTable n5 = new NatTable(gridPanel, gridLayer, false);
        n5.addConfiguration(new DefaultNatTableStyleConfiguration());
        n5.addConfiguration(new HeaderMenuConfiguration(n5));
        n5.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n5);

        // example for mixed percentage sizing in a grid
        // configure not every column with the exact percentage value, this way
        // the columns for which
        // no exact values are set will use the remaining space
        gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer n6DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n6DataLayer.setColumnWidthByPosition(0, 20);
        n6DataLayer.setColumnWidthByPosition(2, 20);
        n6DataLayer.setColumnPercentageSizing(true);
        final NatTable n6 = new NatTable(gridPanel, gridLayer, false);
        n6.addConfiguration(new DefaultNatTableStyleConfiguration());
        n6.addConfiguration(new HeaderMenuConfiguration(n6));
        n6.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n6);

        // example for mixed fixed/percentage sizing in a grid
        // configure not every column with the exact percentage value, this way
        // the columns for which
        // no exact values are set will use the remaining space
        gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer mixGridDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();
        mixGridDataLayer.setColumnPercentageSizing(true);
        mixGridDataLayer.setColumnPercentageSizing(0, false);
        mixGridDataLayer.setColumnPercentageSizing(1, false);
        mixGridDataLayer.setColumnWidthByPosition(0, 100);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private NatTableFixture natTable;
    private DummyGridLayerStack gridLayerStack;

    @Before
    public void setup() {
        gridLayerStack = new DummyGridLayerStack(5, 5);
        natTable = new NatTableFixture(gridLayerStack);

        // Ensure no active editor (static) is present
        // Although deprecated this needs to still work for backwards
        // compatibility
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

        assertNull(ActiveCellEditorRegistry.getActiveCellEditor());
    }

    @Test
    public void testDataValidation() {
        DummyGridLayerStack gridLayerStack = new DummyGridLayerStack(5, 5);
        natTable = new NatTableFixture(gridLayerStack);

        // Register custom validation
        DataLayer bodyDataLayer = (DataLayer) gridLayerStack.getBodyDataLayer();
        natTable.registerLabelOnColumn(bodyDataLayer, 0, TEST_LABEL);
        natTable.registerLabelOnColumn(bodyDataLayer, 1, TEST_LABEL_2);

        natTable.enableEditingOnAllCells();
        natTable.getConfigRegistry().registerConfigAttribute(
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.stack.DummyGridLayerStack

    private DummyGridLayerStack gridLayerStack;
    private SelectionLayer selectionLayer;

    @Before
    public void setup() {
        this.gridLayerStack = new DummyGridLayerStack(5, 5);
        this.selectionLayer = this.gridLayerStack.getBodyLayer().getSelectionLayer();
        this.natTable = new NatTableFixture(this.gridLayerStack);

        // Ensure no active editor (static) is present
        // Although deprecated this needs to still work for backwards
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.