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

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


    }

    @Test
    public void testIsCellEditableWithSingleSelection() {
        this.selectionLayer.selectCell(1, 1, false, false);
        PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
        assertFalse(EditUtils.isCellEditable(this.selectionLayer,
                this.natTable.getConfigRegistry(), coord));
    }
View Full Code Here


    @Test
    public void testIsCellEditableWithSingleSelectionEnableEditing() {
        this.natTable.enableEditingOnAllCells();
        this.selectionLayer.selectCell(1, 1, false, false);
        PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
        assertTrue(EditUtils.isCellEditable(this.selectionLayer,
                this.natTable.getConfigRegistry(), coord));
    }
View Full Code Here

        Collection<PositionCoordinate> cells = ArrayUtil
                .asCollection(this.selectionLayer.getSelectedCellPositions());

        Assert.assertEquals(6, cells.size());
        // (1, 0)
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                1, 0)));
        // (1, 1)
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                1, 1)));
        // (1, 2)
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                1, 2)));
        // (2, 0)
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                2, 0)));
        // (2, 1)
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                2, 1)));
        // (2, 2)
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                2, 2)));
    }
View Full Code Here

                false, true));

        Collection<PositionCoordinate> cells = ArrayUtil
                .asCollection(this.selectionLayer.getSelectedCellPositions());
        Assert.assertEquals(1, cells.size());
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                1, 0)));

        // select another cell with control mask
        this.selectionLayer.doCommand(new SelectCellCommand(this.selectionLayer, 2, 0,
                false, true));

        cells = ArrayUtil.asCollection(this.selectionLayer
                .getSelectedCellPositions());
        Assert.assertEquals(1, cells.size());
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                2, 0)));

        // select additional cells with shift mask
        // only the first cell should be selected afterwards
        this.selectionLayer.doCommand(new SelectCellCommand(this.selectionLayer, 2, 10,
                true, false));

        cells = ArrayUtil.asCollection(this.selectionLayer
                .getSelectedCellPositions());
        Assert.assertEquals(1, cells.size());
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                2, 0)));

        // select additional cells with shift mask
        // only the first cell should be selected afterwards
        this.selectionLayer.doCommand(new SelectCellCommand(this.selectionLayer, 10, 0,
                true, false));

        cells = ArrayUtil.asCollection(this.selectionLayer
                .getSelectedCellPositions());
        Assert.assertEquals(1, cells.size());
        Assert.assertTrue(cells.contains(new PositionCoordinate(this.selectionLayer,
                2, 0)));
    }
View Full Code Here

                this.natTable.getConfigRegistry()));
    }

    @Test
    public void testIsCellEditableWithoutSelection() {
        PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 0, 0);
        assertFalse(EditUtils.isCellEditable(this.selectionLayer,
                this.natTable.getConfigRegistry(), coord));
    }
View Full Code Here

    }

    @Test
    public void testIsCellEditableWithoutSelectionEnableEditing() {
        this.natTable.enableEditingOnAllCells();
        PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 0, 0);
        assertTrue(EditUtils.isCellEditable(this.selectionLayer,
                this.natTable.getConfigRegistry(), coord));
    }
View Full Code Here

    }

    @Test
    public void testIsCellEditableWithSingleSelection() {
        this.selectionLayer.selectCell(1, 1, false, false);
        PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
        assertFalse(EditUtils.isCellEditable(this.selectionLayer,
                this.natTable.getConfigRegistry(), coord));
    }
View Full Code Here

    @Test
    public void testIsCellEditableWithSingleSelectionEnableEditing() {
        this.natTable.enableEditingOnAllCells();
        this.selectionLayer.selectCell(1, 1, false, false);
        PositionCoordinate coord = new PositionCoordinate(this.selectionLayer, 1, 1);
        assertTrue(EditUtils.isCellEditable(this.selectionLayer,
                this.natTable.getConfigRegistry(), coord));
    }
View Full Code Here

        // Select three rows for searching
        RowSearchStrategy rowStrategy = new RowSearchStrategy(new int[] { 0, 2,
                4 }, configRegistry);
        PositionCoordinate[] cellsToSearch = rowStrategy
                .getRowCellsToSearch(layer);
        PositionCoordinate cell = cellsToSearch[0];
        Assert.assertEquals(0, cell.getRowPosition());
        cell = cellsToSearch[10];
        Assert.assertEquals(2, cell.getRowPosition());
        cell = cellsToSearch[20];
        Assert.assertEquals(4, cell.getRowPosition());
        Assert.assertEquals(30, cellsToSearch.length);
    }
View Full Code Here

        RowSearchStrategy rowStrategy = new RowSearchStrategy(new int[] { 2, 0,
                4 }, configRegistry);
        rowStrategy
                .setComparator(new CellValueAsStringComparator<Comparable<String>>());
        rowStrategy.setContextLayer(layer);
        PositionCoordinate cell = rowStrategy.executeSearch("[2,2]");
        Assert.assertEquals(2, cell.getColumnPosition());
        Assert.assertEquals(2, cell.getRowPosition());
    }
View Full Code Here

TOP

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

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.