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

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


    protected Runnable getEventNotifier() {
        return new Runnable() {
            @Override
            public void run() {
                if (eventsToProcess && active) {
                    ILayerEvent layerEvent;
                    if (structuralChangeEventsToProcess) {
                        layerEvent = new RowStructuralRefreshEvent(
                                getUnderlyingLayer());
                    } else {
                        layerEvent = new VisualRefreshEvent(
View Full Code Here


            // we need to cleanup the column position list after we toggle
            // because the columns are hidden now
            cleanupColumnIndexes(columnIndexes);
        }

        ILayerEvent event;
        if (wasCollapsed) {
            event = new ShowColumnPositionsEvent(
                    columnGroupExpandCollapseLayer, columnIndexes);
        } else {
            event = new HideColumnPositionsEvent(
View Full Code Here

        List<Integer> rowIndexes = new ArrayList<Integer>(
                RowGroupUtils.getRowIndexesInGroup(model, rowIndex));
        List<Integer> rowPositions = RowGroupUtils.getRowPositionsInGroup(
                rowGroupExpandCollapseLayer, rowIndexes);

        ILayerEvent event;
        if (wasCollapsed) {
            event = new ShowRowPositionsEvent(rowGroupExpandCollapseLayer,
                    rowPositions);
        } else {
            event = new HideRowPositionsEvent(rowGroupExpandCollapseLayer,
View Full Code Here

                        25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 });

        natTableFixture.doCommand(hideAllCommand);
        Assert.assertEquals(1, listenerFixture.getEventsCount());

        ILayerEvent receivedEvent = listenerFixture
                .getReceivedEvent(HideColumnPositionsEvent.class);
        Assert.assertNotNull(receivedEvent);
    }
View Full Code Here

                ILayerListener l = it.next();
                isLastListener = !it.hasNext(); // Lookahead

                // Fire cloned event to first n-1 listeners; fire original event
                // to last listener
                ILayerEvent eventToFire = isLastListener ? event : event
                        .cloneEvent();
                l.handleLayerEvent(eventToFire);
            } while (!isLastListener);
        }
    }
View Full Code Here

        dataLayer.addLayerListener(firstListener);
    }

    @Test
    public void testFireOriginalEventIfOnlyOneListener() {
        ILayerEvent event = new ColumnResizeEvent(dataLayer, 2);
        dataLayer.fireLayerEvent(event);

        List<ILayerEvent> receivedEvents = firstListener.getReceivedEvents();
        assertNotNull(receivedEvents);
        assertEquals(1, receivedEvents.size());
View Full Code Here

    @Test
    public void testFireClonedEventIfMultipleListeners() {
        LayerListenerFixture secondListener = new LayerListenerFixture();
        dataLayer.addLayerListener(secondListener);

        ILayerEvent event = new ColumnResizeEvent(dataLayer, 2);
        dataLayer.fireLayerEvent(event);

        List<ILayerEvent> receivedEvents = firstListener.getReceivedEvents();
        assertNotNull(receivedEvents);
        assertEquals(1, receivedEvents.size());
View Full Code Here

     */
    @Test
    public void testMoveColumnPositionIntoViewportFiresEvent() throws Exception {
        this.viewportLayer.addLayerListener(this.layerListener);
        this.viewportLayer.moveColumnPositionIntoViewport(4);
        ILayerEvent event = this.layerListener.getReceivedEvents().get(0);

        assertTrue(event instanceof IVisualChangeEvent);
    }
View Full Code Here

    @Test
    public void settingViewportColumnOriginFiresEvent() throws Exception {
        this.viewportLayer.addLayerListener(this.layerListener);
        this.viewportLayer.setOriginX(this.viewportLayer.getStartXOfColumnPosition(2));

        ILayerEvent event = this.layerListener.getReceivedEvents().get(0);
        assertTrue(event instanceof IVisualChangeEvent);
    }
View Full Code Here

    public void settingViewportRowOriginFireEvent() throws Exception {
        this.viewportLayer.addLayerListener(this.layerListener);
        this.viewportLayer.setOriginY(this.viewportLayer.getStartYOfRowPosition(1));
        assertEquals(1, this.viewportLayer.getRowIndexByPosition(0));

        ILayerEvent event = this.layerListener.getReceivedEvents().get(0);
        assertTrue(event instanceof IVisualChangeEvent);
    }
View Full Code Here

TOP

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

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.