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

Examples of org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommand


     * org.eclipse.nebula.widgets.nattable.selection.SelectionLayer
     * .MoveDirectionEnum)
     */
    @Override
    public boolean commit(Object canonicalValue, MoveDirectionEnum direction) {
        boolean committed = this.layer.doCommand(new UpdateDataCommand(this.layer,
                this.columnPosition, this.rowPosition, canonicalValue));

        // only move the selection if the update succeeded, otherwise the editor
        // will stay open
        if (committed) {
View Full Code Here


                                        selectedCell.getDataValue(),
                                        editorValue);
                            }
                            ILayer layer = selectedCell.getLayer();

                            layer.doCommand(new UpdateDataCommand(layer,
                                    selectedCell.getColumnPosition(),
                                    selectedCell.getRowPosition(), editorValue));
                        }
                    }
                } else {
View Full Code Here

                .getCheckedCellsCount(columnPosition,
                        natTable.getConfigRegistry());
        boolean targetState = checkedCellsCount < bodyDataLayer.getRowCount();

        for (int rowPosition = 0; rowPosition < bodyDataLayer.getRowCount(); rowPosition++) {
            bodyDataLayer.doCommand(new UpdateDataCommand(bodyDataLayer,
                    columnPosition, rowPosition, targetState));
        }
    }
View Full Code Here

    @Test
    public void shouldHandleClearFilterCommand() throws Exception {
        Assert.assertEquals(13, filterList.size());

        layerUnderTest.doCommand(new UpdateDataCommand(layerUnderTest, 1, 2,
                "ford"));
        Assert.assertEquals(1, filterList.size());

        layerUnderTest.doCommand(new ClearFilterCommand(layerUnderTest, 1));
        Assert.assertEquals(13, filterList.size());
View Full Code Here

    @Test
    public void shouldHandleTheClearAllFiltersCommand() throws Exception {
        Assert.assertEquals(13, filterList.size());

        layerUnderTest.doCommand(new UpdateDataCommand(layerUnderTest, 1, 2,
                "ford"));
        Assert.assertEquals(1, filterList.size());

        layerUnderTest.doCommand(new UpdateDataCommand(layerUnderTest, 0, 2,
                "XXX"));
        Assert.assertEquals(0, filterList.size());

        layerUnderTest.doCommand(new ClearAllFiltersCommand());
        Assert.assertEquals(13, filterList.size());
View Full Code Here

    @Test
    public void shouldHandleClearFilterCommand() throws Exception {
        assertEquals(13, filterList.size());

        layerUnderTest.doCommand(new UpdateDataCommand(layerUnderTest, 1, 0,
                "ford"));
        assertEquals(1, filterList.size());

        layerUnderTest.doCommand(new ClearFilterCommand(layerUnderTest, 1));
        assertEquals(13, filterList.size());
View Full Code Here

    @Test
    public void shouldHandleTheClearAllFiltersCommand() throws Exception {
        assertEquals(13, filterList.size());

        layerUnderTest.doCommand(new UpdateDataCommand(layerUnderTest, 1, 0,
                "ford"));
        assertEquals(1, filterList.size());

        layerUnderTest.doCommand(new UpdateDataCommand(layerUnderTest, 0, 0,
                "XXX"));
        assertEquals(0, filterList.size());

        layerUnderTest.doCommand(new ClearAllFiltersCommand());
        assertEquals(13, filterList.size());
View Full Code Here

            Object newValue = getNewCellValue(command, cell);
            // validate the value
            try {
                if (validator == null
                        || validator.validate(cell, configRegistry, newValue)) {
                    selectionLayer.doCommand(new UpdateDataCommand(
                            selectionLayer, selectedPosition.columnPosition,
                            selectedPosition.rowPosition, newValue));
                } else {
                    log.warn("Tick update failed for cell at " + selectedPosition + " and value " + newValue //$NON-NLS-1$ //$NON-NLS-2$
                            + ". New value is not valid!"); //$NON-NLS-1$
View Full Code Here

    private UpdateDataCommand command;

    @Before
    public void setup() {
        dataLayer = new DataLayerFixture();
        command = new UpdateDataCommand(dataLayer, 2, 2, TEST_VALUE);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommand

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.