Examples of SelectCellCommand


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

    }

    @Test
    public void shouldFireCellSelectionEvent() throws Exception {
        // Grid coordinates
        nattable.doCommand(new SelectCellCommand(nattable, 1, 5, NO_SHIFT,
                NO_CTRL));

        assertEquals(1, listener.getEventsCount());
        assertTrue(listener.containsInstanceOf(CellSelectionEvent.class));
View Full Code Here

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

        };
    }

    @Test
    public void shouldReturnArrayOfCellsForColumnsInSelectionModel() {
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 2, 3,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 4, 1,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 9, 9,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 1, 0,
                false, true));

        ILayerCell[][] columns = commandHandler.assembleColumnHeaders();

        assertEquals(5, columns.length);
View Full Code Here

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

        assertEquals("Column 10", columns[0][4].getDataValue());
    }

    @Test
    public void shouldReturnOnlySelectedBodyCells() {
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 1, 2,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 3, 7,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 4, 8,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 7, 9,
                false, true));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 8, 0,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 9, 9,
                false, true));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 5, 0,
                false, true));

        ILayerCell[] bodyCells = commandHandler.assembleBody(0);
View Full Code Here

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

     * Can't figure out why.
     */
    @Ignore
    @Test
    public void shouldReturnGridWithSelectedCellsAndHeaders() {
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 1, 2,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 3, 7,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 4, 8,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 7, 9,
                false, true));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 8, 0,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 9, 9,
                false, true));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 5, 0,
                false, true));

        ILayerCell[][] copiedGrid = commandHandler
View Full Code Here

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

        checkBodyCells(copiedGrid);
    }

    @Test
    public void shouldReturnGridWithSelectedCellsNoHeaders() {
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 1, 2,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 3, 7,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 4, 8,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 7, 9,
                false, true));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 8, 0,
                false, true));
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 9, 9,
                false, true));
        selectionLayer.doCommand(new SelectColumnCommand(selectionLayer, 5, 0,
                false, true));

        commandHandler = new CopyDataCommandHandler(selectionLayer);
View Full Code Here

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

        assertNotNull(copiedGrid[0][5]);
    }

    @Test
    public void shouldCopySingleCell() {
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 3, 7,
                false, false));

        CopyDataCommandHandler commandHandler = new CopyDataCommandHandler(
                selectionLayer);
        commandHandler.assembleCopiedDataStructure();
View Full Code Here

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

                    .executeSearch(dataValueToFind);

            selectionLayer.fireLayerEvent(new SearchEvent(
                    searchResultCellCoordinate));
            if (searchResultCellCoordinate != null) {
                final SelectCellCommand command = new SelectCellCommand(
                        selectionLayer,
                        searchResultCellCoordinate.columnPosition,
                        searchResultCellCoordinate.rowPosition, false, false);
                command.setForcingEntireCellIntoViewport(true);
                selectionLayer.doCommand(command);
            }
        } finally {
            if (searchEventListener != null) {
                selectionLayer.removeLayerListener(searchEventListener);
View Full Code Here

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

        selections.push(selection);
    }

    private SelectCellCommand createSelectCellCommand(
            PositionCoordinate selection) {
        SelectCellCommand selectCellCommand = new SelectCellCommand(
                selection.getLayer(), selection.columnPosition,
                selection.rowPosition, false, false);
        selectCellCommand.setForcingEntireCellIntoViewport(true);
        return selectCellCommand;
    }
View Full Code Here

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

    @Test
    public void onlyOneRowSelectedAtAnyTime() {
        selectionLayer.getSelectionModel().setMultipleSelectionAllowed(false);

        selectionLayer.clear();
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 1, 0,
                false, true));

        Collection<PositionCoordinate> cells = ArrayUtil
                .asCollection(selectionLayer.getSelectedCellPositions());
        Assert.assertEquals(selectionLayer.getColumnCount(), cells.size());
        Assert.assertEquals(1, selectionLayer.getSelectedRowCount());

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

        cells = ArrayUtil.asCollection(selectionLayer
                .getSelectedCellPositions());
        Assert.assertEquals(selectionLayer.getColumnCount(), cells.size());
        Assert.assertEquals(1, selectionLayer.getSelectedRowCount());

        // select additional cells with shift mask
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 2, 10,
                true, false));

        cells = ArrayUtil.asCollection(selectionLayer
                .getSelectedCellPositions());
        Assert.assertEquals(selectionLayer.getColumnCount(), cells.size());
        Assert.assertEquals(1, selectionLayer.getSelectedRowCount());

        // select additional cells with shift mask
        selectionLayer.doCommand(new SelectCellCommand(selectionLayer, 10, 0,
                true, false));

        cells = ArrayUtil.asCollection(selectionLayer
                .getSelectedCellPositions());
        Assert.assertEquals(selectionLayer.getColumnCount(), cells.size());
View Full Code Here

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

        Assert.assertEquals(0, viewportLayer.getMinimumOriginRowPosition());
    }

    @Test
    public void shouldFreezeRowsAndColumnsBasedOnSelection() {
        compositeFreezeLayer.doCommand(new SelectCellCommand(
                compositeFreezeLayer, 2, 2, false, false));

        // Make sure selection layer processed command
        final PositionCoordinate lastSelectedCell = selectionLayer
                .getLastSelectedCellPosition();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.