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

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


    public PositionCoordinate getSelectionAnchor() {
        if (selectionModel instanceof IMarkerSelectionModel) {
            Point coordinate = ((IMarkerSelectionModel) selectionModel)
                    .getSelectionAnchor();
            return new PositionCoordinate(this, coordinate.x, coordinate.y);
        } else {
            return selectionAnchor;
        }
    }
View Full Code Here


    }

    // Last selected

    public PositionCoordinate getLastSelectedCellPosition() {
        PositionCoordinate coordinate = getLastSelectedCell();
        if (hasSelection(coordinate)) {
            return coordinate;
        } else {
            return null;
        }
View Full Code Here

    PositionCoordinate getLastSelectedCell() {
        if (selectionModel instanceof IMarkerSelectionModel) {
            Point coordinate = ((IMarkerSelectionModel) selectionModel)
                    .getLastSelectedCell();
            return new PositionCoordinate(this, coordinate.x, coordinate.y);
        } else {
            return lastSelectedCell;
        }
    }
View Full Code Here

        this.selectionLayer = selectionLayer;
    }

    @Override
    public void run(NatTable natTable, KeyEvent event) {
        PositionCoordinate anchorPosition = this.selectionLayer.getSelectionAnchor();

        if (anchorPosition.rowPosition != SelectionLayer.NO_SELECTION && anchorPosition.columnPosition != SelectionLayer.NO_SELECTION) {
            int rowIndex = this.selectionLayer.getRowIndexByPosition(anchorPosition.rowPosition);

            TreeExpandCollapseCommand command = new TreeExpandCollapseCommand(rowIndex);
View Full Code Here

    // Selection Anchor

    @Test
    public void testGetAnchorDoesNotDelegateToModel() throws Exception {
        PositionCoordinate existingAnchor = selectionLayer.selectionAnchor;

        assertSame(existingAnchor, selectionLayer.getSelectionAnchor());
    }
View Full Code Here

    @Test
    public void testGetLastSelectedCellDoesNotDelegateToModel()
            throws Exception {
        selectionLayer.selectAll();
        PositionCoordinate existingSelectedCell = selectionLayer.lastSelectedCell;

        assertSame(existingSelectedCell, selectionLayer.getLastSelectedCell());
    }
View Full Code Here

    }

    @Test
    public void testGetLastSelectedCellPosition() throws Exception {
        selectionLayer.selectAll();
        PositionCoordinate existingSelectedCell = selectionLayer
                .getLastSelectedCell();

        assertSame(existingSelectedCell,
                selectionLayer.getLastSelectedCellPosition());
        assertNotNull(existingSelectedCell);
View Full Code Here

    public Class<IStructuralChangeEvent> getLayerEventClass() {
        return IStructuralChangeEvent.class;
    }

    public void handleLayerEvent(IStructuralChangeEvent event) {
        PositionCoordinate topLeftPosition = freezeLayer.getTopLeftPosition();
        PositionCoordinate bottomRightPosition = freezeLayer
                .getBottomRightPosition();

        Collection<StructuralDiff> columnDiffs = event.getColumnDiffs();
        if (columnDiffs != null) {
            int leftOffset = 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

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.