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

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


            int afterDeleteRowPosition = beforeFromRowPositionRange.start
                    - offset;
            if (afterAddRowPosition < afterDeleteRowPosition) {
                afterDeleteRowPosition += cumulativeAddSize;
            }
            rowDiffs.add(new StructuralDiff(DiffTypeEnum.DELETE,
                    beforeFromRowPositionRange, new Range(
                            afterDeleteRowPosition, afterDeleteRowPosition)));
            offset += beforeFromRowPositionRange.size();
        }
        Range beforeAddRange = new Range(beforeToRowPosition,
                beforeToRowPosition);
        offset = 0;
        for (Range beforeFromRowPositionRange : beforeFromRowPositionRanges) {
            int size = beforeFromRowPositionRange.size();
            rowDiffs.add(new StructuralDiff(DiffTypeEnum.ADD, beforeAddRange,
                    new Range(afterAddRowPosition + offset, afterAddRowPosition
                            + offset + size)));
            offset += size;
        }
View Full Code Here


            int afterDeleteColumnPosition = beforeFromColumnPositionRange.start
                    - offset;
            if (afterAddColumnPosition < afterDeleteColumnPosition) {
                afterDeleteColumnPosition += cumulativeAddSize;
            }
            columnDiffs.add(new StructuralDiff(DiffTypeEnum.DELETE,
                    beforeFromColumnPositionRange, new Range(
                            afterDeleteColumnPosition,
                            afterDeleteColumnPosition)));
            offset += beforeFromColumnPositionRange.size();
        }
        Range beforeAddRange = new Range(beforeToColumnPosition,
                beforeToColumnPosition);
        offset = 0;
        for (Range beforeFromColumnPositionRange : beforeFromColumnPositionRanges) {
            int size = beforeFromColumnPositionRange.size();
            columnDiffs.add(new StructuralDiff(DiffTypeEnum.ADD,
                    beforeAddRange, new Range(afterAddColumnPosition + offset,
                            afterAddColumnPosition + offset + size)));
            offset += size;
        }
View Full Code Here

        assertEquals(5, range.start);
        assertEquals(6, range.end);

        // The range Before hide: 5 -> 6
        // The range After hide: 5 -> 5 (row is not there anymore)
        StructuralDiff rowDiff = hideEvent.getRowDiffs().iterator().next();
        assertEquals(5, rowDiff.getBeforePositionRange().start);
        assertEquals(6, rowDiff.getBeforePositionRange().end);
        assertEquals(5, rowDiff.getAfterPositionRange().start);
        assertEquals(5, rowDiff.getAfterPositionRange().end);
    }
View Full Code Here

        assertEquals(5, range.start);
        assertEquals(6, range.end);

        // The range Before hide: 5 -> 6
        // The range After hide: 5 -> 5 (column is not there anymore)
        StructuralDiff columnDiff = hideEvent.getColumnDiffs().iterator()
                .next();
        assertEquals(5, columnDiff.getBeforePositionRange().start);
        assertEquals(6, columnDiff.getBeforePositionRange().end);
        assertEquals(5, columnDiff.getAfterPositionRange().start);
        assertEquals(5, columnDiff.getAfterPositionRange().end);
    }
View Full Code Here

    public void testColumnDiffs() {
        Collection<StructuralDiff> rowDiffs = event.getRowDiffs();
        Assert.assertNotNull(rowDiffs);
        Assert.assertEquals(3, rowDiffs.size());
        Iterator<StructuralDiff> iterator = rowDiffs.iterator();
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(2, 2), new Range(2, 3)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(3, 3), new Range(4, 5)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(5, 5), new Range(7, 10)), iterator.next());
    }
View Full Code Here

        Collection<StructuralDiff> rowDiffs = event.getRowDiffs();
        Assert.assertNotNull(rowDiffs);
        Assert.assertEquals(3, rowDiffs.size());
        Iterator<StructuralDiff> iterator = rowDiffs.iterator();
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(2, 2), new Range(2, 3)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(3, 3), new Range(4, 5)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(5, 5), new Range(7, 10)), iterator.next());

        event.convertToLocal(viewportLayer);

        rowDiffs = event.getRowDiffs();
        Assert.assertNotNull(rowDiffs);
        Assert.assertEquals(3, rowDiffs.size());
        iterator = rowDiffs.iterator();
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(0, 0), new Range(0, 1)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(1, 1), new Range(2, 3)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(3, 3), new Range(5, 8)), iterator.next());
    }
View Full Code Here

    @Test
    public void testColumnDiffs() {
        Collection<StructuralDiff> columnDiffs = event.getColumnDiffs();
        Assert.assertNotNull(columnDiffs);
        Assert.assertEquals(1, columnDiffs.size());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.CHANGE, new Range(
                2, 3), new Range(2, 3)), columnDiffs.iterator().next());
    }
View Full Code Here

        event.convertToLocal(viewportLayer);

        Collection<StructuralDiff> columnDiffs = event.getColumnDiffs();
        Assert.assertNotNull(columnDiffs);
        Assert.assertEquals(1, columnDiffs.size());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.CHANGE, new Range(
                0, 1), new Range(0, 1)), columnDiffs.iterator().next());
    }
View Full Code Here

    public void testColumnDiffs() {
        Collection<StructuralDiff> columnDiffs = event.getColumnDiffs();
        Assert.assertNotNull(columnDiffs);
        Assert.assertEquals(3, columnDiffs.size());
        Iterator<StructuralDiff> iterator = columnDiffs.iterator();
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(2, 2), new Range(2, 3)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(3, 3), new Range(4, 5)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(5, 5), new Range(7, 10)), iterator.next());
    }
View Full Code Here

        Collection<StructuralDiff> columnDiffs = event.getColumnDiffs();
        Assert.assertNotNull(columnDiffs);
        Assert.assertEquals(3, columnDiffs.size());
        Iterator<StructuralDiff> iterator = columnDiffs.iterator();
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(2, 2), new Range(2, 3)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(3, 3), new Range(4, 5)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(5, 5), new Range(7, 10)), iterator.next());

        event.convertToLocal(viewportLayer);

        columnDiffs = event.getColumnDiffs();
        Assert.assertNotNull(columnDiffs);
        Assert.assertEquals(3, columnDiffs.size());
        iterator = columnDiffs.iterator();
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(0, 0), new Range(0, 1)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(1, 1), new Range(2, 3)), iterator.next());
        Assert.assertEquals(new StructuralDiff(DiffTypeEnum.ADD,
                new Range(3, 3), new Range(5, 8)), iterator.next());
    }
View Full Code Here

TOP

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

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.