Package org.eclipse.nebula.widgets.nattable.layer.event

Examples of org.eclipse.nebula.widgets.nattable.layer.event.RowDeleteEvent


            final List<Range> insertRanges) {
        if (!deleteRanges.isEmpty()) {
            Display.getDefault().syncExec(new Runnable() {
                @Override
                public void run() {
                    fireLayerEvent(new RowDeleteEvent(getUnderlyingLayer(),
                            deleteRanges));
                }
            });
        }
View Full Code Here


        assertEquals("two", rowReorderLayer.getDataValueByPosition(0, 2));
        assertEquals("one", rowReorderLayer.getDataValueByPosition(0, 3));

        // delete row position 1 (index 2: value "three")
        contents.remove(2);
        underlyingLayer.fireLayerEvent(new RowDeleteEvent(underlyingLayer, 2));

        assertEquals(2, rowReorderLayer.getRowIndexByPosition(0));
        assertEquals(1, rowReorderLayer.getRowIndexByPosition(1));
        assertEquals(0, rowReorderLayer.getRowIndexByPosition(2));
        assertEquals(-1, rowReorderLayer.getRowIndexByPosition(3));
View Full Code Here

        assertEquals("one", rowReorderLayer.getDataValueByPosition(0, 3));

        // delete last row in list
        int lastRowIndex = contents.size() - 1;
        contents.remove(lastRowIndex);
        underlyingLayer.fireLayerEvent(new RowDeleteEvent(underlyingLayer,
                lastRowIndex));

        assertEquals(2, rowReorderLayer.getRowIndexByPosition(0));
        assertEquals(1, rowReorderLayer.getRowIndexByPosition(1));
        assertEquals(0, rowReorderLayer.getRowIndexByPosition(2));
View Full Code Here

        assertEquals("one", rowReorderLayer.getDataValueByPosition(0, 3));

        // delete rows in the middle
        contents.remove(1);
        contents.remove(1);
        underlyingLayer.fireLayerEvent(new RowDeleteEvent(underlyingLayer,
                new Range(1, 3)));

        assertEquals(2, rowReorderLayer.getRowCount());
        assertEquals(1, rowReorderLayer.getRowIndexByPosition(0));
        assertEquals(0, rowReorderLayer.getRowIndexByPosition(1));
View Full Code Here

    public void shouldClearSelectionIfASelectedRowIsModified() throws Exception {
        selectionModel.addSelection(2, 3);

        SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(
                selectionLayer);
        handler.handleLayerEvent(new RowDeleteEvent(dataLayer, 3));

        Assert.assertTrue(selectionModel.isEmpty());
    }
View Full Code Here

            throws Exception {
        selectionModel.addSelection(2, 3);

        SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(
                selectionLayer);
        handler.handleLayerEvent(new RowDeleteEvent(dataLayer, 5));

        Assert.assertFalse(selectionModel.isEmpty());
        Assert.assertTrue(selectionModel.isRowPositionSelected(3));
    }
View Full Code Here

            throws Exception {
        selectionModel.addSelection(3, 4);

        SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(
                selectionLayer);
        handler.handleLayerEvent(new RowDeleteEvent(dataLayer, 5));

        Assert.assertFalse(selectionModel.isEmpty());
        Assert.assertTrue(selectionModel.isRowPositionSelected(4));
    }
View Full Code Here

    public void shouldClearSelectionIfListIsCleared() {
        selectionModel.addSelection(3, 4);

        SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(
                selectionLayer);
        handler.handleLayerEvent(new RowDeleteEvent(dataLayer, new Range(0, 9)));

        Assert.assertTrue(selectionModel.isEmpty());
    }
View Full Code Here

        assertEquals(80, this.viewportLayer.getMinimumOrigin().getY());

        // fake a multi row delete with no details on which rows are deleted
        // technically the same as collapsing or filtering a GlazedLists
        this.rowCount = 2;
        this.dataLayer.fireLayerEvent(new RowDeleteEvent(this.dataLayer, new ArrayList<Range>()));

        assertEquals(0, this.freezeLayer.getColumnCount());
        assertEquals(2, this.freezeLayer.getRowCount());
        assertEquals(-1, this.freezeLayer.getBottomRightPosition().columnPosition);
        assertEquals(3, this.freezeLayer.getBottomRightPosition().rowPosition);
View Full Code Here

        assertEquals("four", rowHideShowLayer.getDataValueByPosition(0, 2));
        assertEquals("five", rowHideShowLayer.getDataValueByPosition(0, 3));

        // delete row index 1: value "two")
        contents.remove(1);
        underlyingLayer.fireLayerEvent(new RowDeleteEvent(underlyingLayer, 1));

        assertEquals(3, rowHideShowLayer.getRowCount());
        assertEquals(0, rowHideShowLayer.getRowIndexByPosition(0));
        assertEquals(2, rowHideShowLayer.getRowIndexByPosition(1));
        assertEquals(3, rowHideShowLayer.getRowIndexByPosition(2));
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.layer.event.RowDeleteEvent

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.