Package org.eclipse.nebula.widgets.nattable.coordinate

Examples of org.eclipse.nebula.widgets.nattable.coordinate.Range


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


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

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

        selectionsLock.readLock().lock();

        try {
            for (Serializable rowId : selectedRows.keySet()) {
                int rowPosition = getRowPositionById(rowId);
                selectedRowRanges.add(new Range(rowPosition, rowPosition + 1));
            }
        } finally {
            selectionsLock.readLock().unlock();
        }
View Full Code Here

    public Collection<StructuralDiff> getColumnDiffs() {
        Collection<StructuralDiff> columnDiffs = new ArrayList<StructuralDiff>();

        int offset = 0;
        for (Range range : getColumnPositionRanges()) {
            columnDiffs.add(new StructuralDiff(DiffTypeEnum.ADD, new Range(
                    range.start - offset, range.start - offset), range));
            offset += range.size();
        }

        return columnDiffs;
View Full Code Here

    public Collection<StructuralDiff> getColumnDiffs() {
        Collection<StructuralDiff> columnDiffs = new ArrayList<StructuralDiff>();

        for (Range range : getColumnPositionRanges()) {
            StructuralDiff diff = new StructuralDiff(DiffTypeEnum.DELETE,
                    range, new Range(range.start, range.start));
            columnDiffs.add(diff);
        }

        return columnDiffs;
    }
View Full Code Here

    public Collection<StructuralDiff> getRowDiffs() {
        Collection<StructuralDiff> rowDiffs = new ArrayList<StructuralDiff>();

        for (Range range : getRowPositionRanges()) {
            StructuralDiff diff = new StructuralDiff(DiffTypeEnum.DELETE,
                    range, new Range(range.start, range.start));
            rowDiffs.add(diff);
        }

        return rowDiffs;
    }
View Full Code Here

    public Collection<StructuralDiff> getRowDiffs() {
        Collection<StructuralDiff> rowDiffs = new ArrayList<StructuralDiff>();

        int offset = 0;
        for (Range range : getRowPositionRanges()) {
            rowDiffs.add(new StructuralDiff(DiffTypeEnum.ADD, new Range(
                    range.start - offset, range.start - offset), range));
            offset += range.size();
        }

        return rowDiffs;
View Full Code Here

import org.eclipse.nebula.widgets.nattable.layer.event.ColumnVisualChangeEvent;

public class SortColumnEvent extends ColumnVisualChangeEvent {

    public SortColumnEvent(ILayer layer, int columnPosition) {
        super(layer, new Range(columnPosition, columnPosition + 1));
    }
View Full Code Here

        if (event instanceof ColumnVisualUpdateEvent) {
            ColumnVisualUpdateEvent update = (ColumnVisualUpdateEvent) event;
            // if more than one column has changed repaint the whole table
            Collection<Range> ranges = update.getColumnPositionRanges();
            if (ranges.size() == 1) {
                Range range = ranges.iterator().next();
                if (range.end - range.start == 1) {
                    repaintColumn(range.start);
                    return;
                }
            }
        }

        if (event instanceof RowVisualUpdateEvent) {
            RowVisualUpdateEvent update = (RowVisualUpdateEvent) event;
            // if more than one row has changed repaint the whole table
            Collection<Range> ranges = update.getRowPositionRanges();
            if (ranges.size() == 1) {
                Range range = ranges.iterator().next();
                if (range.end - range.start == 1) {
                    repaintRow(range.start);
                    return;
                }
            }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.coordinate.Range

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.