Examples of ILayerListener


Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        // Build expected cell positions to redraw
        final Set<Rectangle> expectedPositions = new HashSet<Rectangle>();
        expectedPositions.add(new Rectangle(0, 0, 20, 20));

        reorderLayer.addLayerListener(new ILayerListener() {
            @Override
            public void handleLayerEvent(ILayerEvent event) {
                RowReorderEvent multiReorder = (RowReorderEvent) event;
                assertTrue(multiReorder.getChangedPositionRectangles()
                        .containsAll(expectedPositions));
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        // Build expected cell positions to redraw
        final Set<Rectangle> expectedPositions = new HashSet<Rectangle>();
        expectedPositions.add(new Rectangle(0, 0, 20, 20));

        reorderLayer.addLayerListener(new ILayerListener() {
            @Override
            public void handleLayerEvent(ILayerEvent event) {
                RowReorderEvent multiReorder = (RowReorderEvent) event;
                assertTrue(multiReorder.getChangedPositionRectangles()
                        .containsAll(expectedPositions));
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        // Build expected cell positions to redraw
        final Set<Rectangle> expectedPositions = new HashSet<Rectangle>();
        expectedPositions.add(new Rectangle(0, 0, 20, 20));

        reorderLayer.addLayerListener(new ILayerListener() {
            public void handleLayerEvent(ILayerEvent event) {
                ColumnReorderEvent multiReorder = (ColumnReorderEvent) event;
                assertTrue(multiReorder.getChangedPositionRectangles()
                        .containsAll(expectedPositions));
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        // Build expected cell positions to redraw
        final Set<Rectangle> expectedPositions = new HashSet<Rectangle>();
        expectedPositions.add(new Rectangle(0, 0, 20, 20));

        reorderLayer.addLayerListener(new ILayerListener() {
            public void handleLayerEvent(ILayerEvent event) {
                ColumnReorderEvent multiReorder = (ColumnReorderEvent) event;
                assertTrue(multiReorder.getChangedPositionRectangles()
                        .containsAll(expectedPositions));
            }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        return nattable;
    }

    private void addCustomSelectionBehaviour() {
        nattable.addLayerListener(new ILayerListener() {

            // Default selection behavior selects cells by default.
            public void handleLayerEvent(ILayerEvent event) {
                if (event instanceof CellSelectionEvent) {
                    CellSelectionEvent cellEvent = (CellSelectionEvent) event;
                    log("Selected cell: ["
                            + cellEvent.getRowPosition()
                            + ", "
                            + cellEvent.getColumnPosition()
                            + "], "
                            + nattable.getDataValueByPosition(
                                    cellEvent.getColumnPosition(),
                                    cellEvent.getRowPosition()));
                }
            }
        });

        // Events are fired whenever selection occurs. These can be use to
        // trigger
        // external actions as required. Also you can use this data to pull out
        // the backing data from the IRowDataProvider. Example:
        // rowDataProvider.getRowObject(natTable.getRowIndexByPosition(selectedRowPosition));
        nattable.addLayerListener(new ILayerListener() {
            public void handleLayerEvent(ILayerEvent event) {
                if (event instanceof RowSelectionEvent) {
                    RowSelectionEvent rowEvent = (RowSelectionEvent) event;
                    log("Selected Row: "
                            + ObjectUtils.toString(rowEvent
                                    .getRowPositionRanges()));
                }
            }
        });

        nattable.addLayerListener(new ILayerListener() {
            public void handleLayerEvent(ILayerEvent event) {
                if (event instanceof ColumnSelectionEvent) {
                    ColumnSelectionEvent columnEvent = (ColumnSelectionEvent) event;
                    log("Selected Column: "
                            + columnEvent.getColumnPositionRanges());
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

            throws PatternSyntaxException {
        searchCommand.convertToTargetLayer(targetLayer);

        AbstractSearchStrategy searchStrategy = (AbstractSearchStrategy) searchCommand
                .getSearchStrategy();
        final ILayerListener searchEventListener = searchCommand
                .getSearchEventListener();
        if (searchEventListener != null) {
            selectionLayer.addLayerListener(searchEventListener);
        }
        try {
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        Assert.assertEquals(1, selectionLayer.getSelectedRowCount());
    }

    @Test
    public void onlySelectRowEventsFired() {
        nattable.addLayerListener(new ILayerListener() {
            @Override
            public void handleLayerEvent(ILayerEvent event) {
                if (event instanceof CellSelectionEvent) {
                    fail("CellSelectionEvent fired for row selection");
                }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

        natTable.enableEditingOnAllCells();

        final boolean[] inlineFired = new boolean[1];
        inlineFired[0] = false;
        selectionLayer.addLayerListener(new ILayerListener() {

            @Override
            public void handleLayerEvent(ILayerEvent event) {
                if (event instanceof InlineCellEditEvent) {
                    inlineFired[0] = true;
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

                ConfigRegistry configRegistry) {
            final CachedValueCalculatingDataProvider<NumberValues> dataProvider = new CachedValueCalculatingDataProvider<NumberValues>(
                    valuesToShow, new BasicDataColumnAccessor());
            bodyDataLayer = new DataLayer(dataProvider);
            // adding this listener will trigger updates on data changes
            bodyDataLayer.addLayerListener(new ILayerListener() {
                @Override
                public void handleLayerEvent(ILayerEvent event) {
                    if (event instanceof IVisualChangeEvent) {
                        dataProvider.valueCache.clearCache();
                    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.layer.ILayerListener

                columnPosition, rowPosition, false, false));
    }

    private void doTest() throws PatternSyntaxException {
        // Register call back
        final ILayerListener listener = new ILayerListener() {
            public void handleLayerEvent(ILayerEvent event) {
                if (event instanceof SearchEvent) {
                    // Check event, coordinate should be in composite layer
                    // coordinates
                    SearchEvent searchEvent = (SearchEvent) event;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.