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

Examples of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler


    @Test
    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


    @Test
    public void shouldLeaveSelectionUnchangedIfASelectedRowIsNotModified()
            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

    @Test
    public void shouldLeaveSelectionUnchangedIfTheFollowingRowIsModified()
            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

    @Test
    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

    @Test
    public void shouldClearSelectionIfAllRowsAreHidden() {
        selectionModel.addSelection(3, 4);

        SelectionLayerStructuralChangeEventHandler handler = new SelectionLayerStructuralChangeEventHandler(
                selectionLayer);
        List<Integer> rows = new ArrayList<Integer>();
        rows.add(0);
        rows.add(1);
        rows.add(2);
        rows.add(3);
        rows.add(4);
        rows.add(5);
        rows.add(6);
        rows.add(7);
        rows.add(8);
        rows.add(9);
        handler.handleLayerEvent(new HideRowPositionsEvent(dataLayer, rows));

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

        selectColumnCommandHandler = new SelectColumnCommandHandler(this);

        registerCommandHandlers();

        if (registerDefaultEventHandler) {
            registerEventHandler(new SelectionLayerStructuralChangeEventHandler(
                    this));
        }
        if (useDefaultConfiguration) {
            addConfiguration(new DefaultSelectionLayerConfiguration());
        }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.selection.event.SelectionLayerStructuralChangeEventHandler

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.