Package org.eclipse.nebula.widgets.nattable.grid.data

Examples of org.eclipse.nebula.widgets.nattable.grid.data.DummySpanningBodyDataProvider


                .run(new ViewportSelectionSpanningDataLayerExample());
    }

    public Control createExampleControl(Composite parent) {
        return new NatTable(parent, new ViewportLayer(new SelectionLayer(
                new SpanningDataLayer(new DummySpanningBodyDataProvider(
                        1000000, 1000000)))));
    }
View Full Code Here


    public Control createExampleControl(Composite parent) {
        CompositeLayer layer = new CompositeLayer(1, 1);
        layer.setChildLayer(GridRegion.BODY, new ViewportLayer(
                new SelectionLayer(new SpanningDataLayer(
                        new DummySpanningBodyDataProvider(1000000, 1000000)))),
                0, 0);
        return new NatTable(parent, layer);
    }
View Full Code Here

    @Test
    public void openEditorForSpannedCellsShouldOpenInline() throws Exception {
        CompositeLayer layer = new CompositeLayer(1, 1);
        SelectionLayer selectionLayer = new SelectionLayer(
                new SpanningDataLayer(new DummySpanningBodyDataProvider(100,
                        100)));
        layer.setChildLayer(GridRegion.BODY, new ViewportLayer(selectionLayer),
                0, 0);
        natTable = new NatTableFixture(layer, 1200, 300, false);
View Full Code Here

    }

    @Test
    public void updateAllUnderlyingCellsIfSpanned() throws Exception {
        CompositeLayer layer = new CompositeLayer(1, 1);
        DummySpanningBodyDataProvider dataProvider = new DummySpanningBodyDataProvider(
                100, 100);
        SelectionLayer selectionLayer = new SelectionLayer(
                new SpanningDataLayer(dataProvider));
        layer.setChildLayer(GridRegion.BODY, new ViewportLayer(selectionLayer),
                0, 0);
        natTable = new NatTableFixture(layer, 1200, 300, false);

        layer.addConfiguration(new DefaultEditBindings());
        layer.addConfiguration(new DefaultEditConfiguration());

        natTable.enableEditingOnAllCells();

        natTable.configure();

        assertEquals("Col: 1, Row: 1", dataProvider.getDataValue(0, 0));
        assertEquals("Col: 1, Row: 2", dataProvider.getDataValue(0, 1));
        assertEquals("Col: 2, Row: 1", dataProvider.getDataValue(1, 0));
        assertEquals("Col: 2, Row: 2", dataProvider.getDataValue(1, 1));

        natTable.doCommand(new SelectCellCommand(natTable, 1, 1, false, false));
        natTable.notifyListeners(SWT.KeyDown, SWTUtils.keyEventWithChar('C'));

        assertNotNull(natTable.getActiveCellEditor());

        natTable.getActiveCellEditor().getEditorControl()
                .notifyListeners(SWT.KeyDown, SWTUtils.keyEvent(SWT.CR));

        assertEquals("C", dataProvider.getDataValue(0, 0));
        assertEquals("C", dataProvider.getDataValue(0, 1));
        assertEquals("C", dataProvider.getDataValue(1, 0));
        assertEquals("C", dataProvider.getDataValue(1, 1));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.grid.data.DummySpanningBodyDataProvider

Copyright © 2018 www.massapicom. 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.