Package org.eclipse.nebula.widgets.nattable.test.fixture

Examples of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture


                        return rowObject.getSecurity_id();
                    }

                }));

        this.natTable = new NatTableFixture(this.gridLayerStack);

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


    @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
        // compatibility
        assertNull(ActiveCellEditorRegistry.getActiveCellEditor());
View Full Code Here

public class RowHideShowLayerTest2 {

    @Test
    public void shouldFireTheCorrectEventOnRowHide() throws Exception {
        NatTable natTable = new NatTableFixture(new Shell(),
                new DummyGridLayerStack() {

                    @Override
                    protected void init(IUniqueIndexLayer bodyDataLayer,
                            IUniqueIndexLayer columnHeaderDataLayer,
                            IUniqueIndexLayer rowHeaderDataLayer,
                            IUniqueIndexLayer cornerDataLayer) {
                        RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(
                                bodyDataLayer);
                        super.init(rowHideShowLayer, columnHeaderDataLayer,
                                rowHeaderDataLayer, cornerDataLayer);
                    }

                });
        LayerListenerFixture listener = new LayerListenerFixture();

        natTable.addLayerListener(listener);

        // Grid coordinates
        natTable.doCommand(new RowHideCommand(natTable, 5));

        assertEquals(1, listener.getReceivedEvents().size());
        HideRowPositionsEvent hideEvent = (HideRowPositionsEvent) listener
                .getReceivedEvents().get(0);
View Full Code Here

     * Integration test
     */
    @Test
    public void scrollAndHideTheLastRow() throws Exception {
        // Total rows in fixture - 20 (index 0 - 19)
        NatTableFixture natTable = new NatTableFixture(new Shell(),
                new DummyGridLayerStack() {

                    @Override
                    protected void init(IUniqueIndexLayer bodyDataLayer,
                            IUniqueIndexLayer columnHeaderDataLayer,
                            IUniqueIndexLayer rowHeaderDataLayer,
                            IUniqueIndexLayer cornerDataLayer) {
                        RowHideShowLayer rowHideShowLayer = new RowHideShowLayer(
                                bodyDataLayer);
                        super.init(rowHideShowLayer, columnHeaderDataLayer,
                                rowHeaderDataLayer, cornerDataLayer);
                    }

                }, 600, 120);
        LayerListenerFixture natTableListener = new LayerListenerFixture();
        natTable.addLayerListener(natTableListener);

        // Scroll to position 15 in grid/15 in body
        natTable.scrollToRow(15);
        assertEquals(15, natTable.getRowIndexByPosition(1));

        // Hide last row - position 5/index 19
        assertEquals(19, natTable.getRowIndexByPosition(5));
        natTable.doCommand(new RowHideCommand(natTable, 5));

        // Assert event received
        assertNotNull(natTableListener
                .getReceivedEvent(HideRowPositionsEvent.class));
        HideRowPositionsEvent hideEvent = (HideRowPositionsEvent) natTableListener
View Full Code Here

        IUniqueIndexLayer selectionLayer = new SelectionLayer(
                columnHideShowLayer);
        layerStackWithSummary = new ViewportLayer(selectionLayer);

        // NatTableFixture initializes the client area
        natTable = new NatTableFixture(layerStackWithSummary, false);
        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new TestSummaryRowConfiguration());

        natTable.configure();
    }
View Full Code Here

    private Properties properties;
    private NatTableFixture natTableFixture;

    @Before
    public void setup() {
        natTableFixture = new NatTableFixture(new Shell(),
                new DummyGridLayerStack() {

                    @Override
                    protected void init(IUniqueIndexLayer bodyDataLayer,
                            IUniqueIndexLayer columnHeaderDataLayer,
View Full Code Here

    private NatTableFixture natTableFixture;

    @Before
    public void setUpCustomCellLabel() {
        DummyGridLayerStack gridLayerStack = new DummyGridLayerStack(5, 5);
        natTableFixture = new NatTableFixture(gridLayerStack);

        // Register custom label
        DataLayer bodyDataLayer = (DataLayer) gridLayerStack.getBodyDataLayer();
        natTableFixture.registerLabelOnColumn(bodyDataLayer, 0, TEST_LABEL);
    }
View Full Code Here

        LayerAssert.assertLayerEquals(expectedLayer, hideShowLayer);
    }

    @Test
    public void shouldFireTheCorrectEventOnColumnHide() throws Exception {
        NatTable natTable = new NatTableFixture();
        LayerListenerFixture listener = new LayerListenerFixture();

        natTable.addLayerListener(listener);

        // Grid coordinates
        natTable.doCommand(new ColumnHideCommand(natTable, 5));

        assertEquals(1, listener.getReceivedEvents().size());
        HideColumnPositionsEvent hideEvent = (HideColumnPositionsEvent) listener
                .getReceivedEvents().get(0);
View Full Code Here

     * Integration test
     */
    @Test
    public void scrollAndHideTheLastColumn() throws Exception {
        // Total columns in fixture - 20 (index 0 - 19)
        NatTableFixture natTable = new NatTableFixture();
        LayerListenerFixture natTableListener = new LayerListenerFixture();
        natTable.addLayerListener(natTableListener);

        // Scroll to position 14 in grid/14 in body
        natTable.scrollToColumn(14);
        assertEquals(14, natTable.getColumnIndexByPosition(1));

        // Hide last column - position 6/index 19
        assertEquals(19, natTable.getColumnIndexByPosition(6));
        natTable.doCommand(new ColumnHideCommand(natTable, 6));

        // Assert event received
        assertNotNull(natTableListener
                .getReceivedEvent(HideColumnPositionsEvent.class));
        HideColumnPositionsEvent hideEvent = (HideColumnPositionsEvent) natTableListener
View Full Code Here

    /**
     * Test for bug NTBL-431
     */
    @Test
    public void reiszeColumnInATableWithNoRows() throws Exception {
        NatTableFixture natTable = new NatTableFixture(new DummyGridLayerStack(
                5, 0), true);

        assertEquals(100, natTable.getColumnWidthByPosition(2));
        natTable.doCommand(new ColumnResizeCommand(natTable, 2, 150));

        assertEquals(150, natTable.getColumnWidthByPosition(2));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture

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.