Package org.eclipse.nebula.widgets.nattable.selection.command

Examples of org.eclipse.nebula.widgets.nattable.selection.command.SelectCellCommand


        viewportLayer.resetOrigin(viewportLayer.getStartXOfColumnPosition(0),
                viewportLayer.getStartYOfRowPosition(0));
        viewportLayer.setOriginX(viewportLayer.getStartXOfColumnPosition(1));
        Assert.assertEquals(1, viewportLayer.getColumnIndexByPosition(0));

        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 3, 3,
                false, false));
        compositeFreezeLayer.doCommand(new FreezeSelectionCommand());

        // Freezelayer
        Assert.assertEquals(2, freezeLayer.getColumnCount());
View Full Code Here


        viewportLayer.resetOrigin(viewportLayer.getStartXOfColumnPosition(0),
                viewportLayer.getStartYOfRowPosition(0));
        viewportLayer.setOriginX(viewportLayer.getStartXOfColumnPosition(1));
        Assert.assertEquals(1, viewportLayer.getColumnIndexByPosition(0));

        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 3, 3,
                false, false));
        compositeFreezeLayer.doCommand(new FreezeSelectionCommand());

        // Move right edge out of frozen area
        Assert.assertEquals(2, freezeLayer.getColumnCount());
View Full Code Here

public class SelectCellAction extends AbstractMouseSelectionAction {

    @Override
    public void run(NatTable natTable, MouseEvent event) {
        super.run(natTable, event);
        natTable.doCommand(new SelectCellCommand(natTable,
                getGridColumnPosition(), getGridRowPosition(),
                isWithShiftMask(), isWithControlMask()));
    }
View Full Code Here

        }
    }

    public void fireSelectionCommand(NatTable natTable, int columnPosition,
            int rowPosition, boolean shiftMask, boolean controlMask) {
        natTable.doCommand(new SelectCellCommand(natTable, columnPosition,
                rowPosition, shiftMask, controlMask));
    }
View Full Code Here

        this.withShiftMask = withShiftMask;
        this.withControlMask = withControlMask;
    }

    public void run(NatTable natTable, MouseEvent event) {
        new SelectCellCommand(natTable, natTable.getColumnPositionByX(event.x),
                natTable.getRowPositionByY(event.y), withShiftMask,
                withControlMask);
    }
View Full Code Here

    @Test
    public void willSelectBodyCellAndShouldHaveColumnHeaderSelected() {
        // Select body cell
        // The row position is a grid layer position
        gridLayer
                .doCommand(new SelectCellCommand(gridLayer, 2, 2, false, false));

        // Get row header cell corresponding to the selected body cell
        RowHeaderLayer rowHeaderLayer = (RowHeaderLayer) gridLayer
                .getChildLayerByLayoutCoordinate(0, 1);
        // The column position is 0 because it takes into account the offset of
View Full Code Here

    }

    @Test
    public void navigationWithTab() throws Exception {
        natTable.enableEditingOnAllCells();
        natTable.doCommand(new SelectCellCommand(natTable, 1, 1, false, false));

        // Edit cell
        ILayerCell cell = natTable.getCellByPosition(1, 1);
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));
View Full Code Here

                getStartingWithCValidator(), DisplayMode.EDIT, TEST_LABEL);

        // Start editing 1,1
        ILayerCell cell = natTable.getCellByPosition(1, 1);
        assertEquals("Col: 1, Row: 1", cell.getDataValue());
        natTable.doCommand(new SelectCellCommand(natTable, 1, 1, false, false));

        // Column position 1 - originally valid
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));
        assertTrue(natTable.getActiveCellEditor().validateCanonicalValue(
View Full Code Here

    @Test
    public void directlyTypingInACellShoudlStartEditing() throws Exception {
        // Press 'A'
        natTable.enableEditingOnAllCells();
        natTable.doCommand(new SelectCellCommand(natTable, 1, 1, false, false));
        natTable.notifyListeners(SWT.KeyDown, SWTUtils.keyEventWithChar('A'));

        // Verify edit mode
        assertNotNull(natTable.getActiveCellEditor());
        assertEquals("A", natTable.getActiveCellEditor().getCanonicalValue());
View Full Code Here

        natTable.getConfigRegistry().registerConfigAttribute(
                EditConfigAttributes.DATA_VALIDATOR,
                getStartingWithCValidator(), DisplayMode.EDIT, TEST_LABEL);

        // Enter 'A' in the cell
        natTable.doCommand(new SelectCellCommand(natTable, 1, 1, false, false));
        natTable.notifyListeners(SWT.KeyDown, SWTUtils.keyEventWithChar('A'));
        assertEquals("A", natTable.getActiveCellEditor().getCanonicalValue());
        assertFalse(natTable.getActiveCellEditor().validateCanonicalValue(
                natTable.getActiveCellEditor().getCanonicalValue()));
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.selection.command.SelectCellCommand

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.