Examples of EditCellCommand


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

    @Override
    public void run(NatTable natTable, MouseEvent event) {
        int columnPosition = natTable.getColumnPositionByX(event.x);
        int rowPosition = natTable.getRowPositionByY(event.y);

        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), natTable.getCellByPosition(
                columnPosition, rowPosition)));
    }
View Full Code Here

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

        int columnPosition = natTable.getColumnPositionByX(event.x);
        int rowPosition = natTable.getRowPositionByY(event.y);

        if (columnPosition == originalColumnPosition
                && rowPosition == originalRowPosition) {
            natTable.doCommand(new EditCellCommand(natTable, natTable
                    .getConfigRegistry(), natTable.getCellByPosition(
                    columnPosition, rowPosition)));
        }
    }
View Full Code Here

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

    @Test
    public void testEditorRemovedWhenClosed() {
        natTable.enableEditingOnAllCells();

        ILayerCell cell = natTable.getCellByPosition(4, 4);
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));

        // close the editor
        ActiveCellEditorRegistry.getActiveCellEditor().close();
View Full Code Here

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

    }

    @Test
    public void testNotEditableByDefault() {
        ILayerCell cell = natTable.getCellByPosition(4, 4);
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));

        assertNull(natTable.getActiveCellEditor());
        assertNull(ActiveCellEditorRegistry.getActiveCellEditor());
    }
View Full Code Here

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

    @Test
    public void testEditorActivatedDuringInlineCellEdit() {
        natTable.enableEditingOnAllCells();

        ILayerCell cell = natTable.getCellByPosition(4, 4);
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));

        ICellEditor cellEditor = natTable.getActiveCellEditor();
        assertNotNull(cellEditor);
        assertTrue(cellEditor instanceof TextCellEditor);
View Full Code Here

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

        natTable.getConfigRegistry().registerConfigAttribute(
                EditConfigAttributes.CELL_EDITABLE_RULE,
                IEditableRule.NEVER_EDITABLE, DisplayMode.NORMAL,
                AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);

        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), natTable.getCellByPosition(4,
                COLUMN_HEADER_ROW_COUNT + 2)));
        assertNotNull(natTable.getActiveCellEditor());
        assertNotNull(ActiveCellEditorRegistry.getActiveCellEditor());

        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), natTable.getCellByPosition(4,
                COLUMN_HEADER_ROW_COUNT + 3)));
        assertNotNull(natTable.getActiveCellEditor());
        assertFalse(natTable.getActiveCellEditor().isClosed());
        assertNotNull(ActiveCellEditorRegistry.getActiveCellEditor());
View Full Code Here

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

    @Test
    public void testEditorResize() {
        natTable.enableEditingOnAllCells();

        ILayerCell cell = natTable.getCellByPosition(4, 4);
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));
        assertEquals(new Rectangle(340, 80, 99, 19), natTable
                .getActiveCellEditor().getEditorControl().getBounds());

        natTable.doCommand(new ColumnResizeCommand(natTable, 2, 110));
View Full Code Here

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

        ILayerCell cell = natTable.getCellByPosition(1, 1);
        assertEquals("Col: 1, Row: 1", cell.getDataValue());

        // Column index 0 never valid
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));
        assertFalse(natTable.getActiveCellEditor().validateCanonicalValue(
                cell.getDataValue()));

        cell = natTable.getCellByPosition(2, 1);
        assertEquals("Col: 2, Row: 1", cell.getDataValue());

        // Column index 1 always valid
        natTable.doCommand(new EditCellCommand(natTable, natTable
                .getConfigRegistry(), cell));
        assertTrue(natTable.getActiveCellEditor().validateCanonicalValue(
                cell.getDataValue()));
    }
View Full Code Here

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

        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));

        // Press tab - 3 times
        Text textControl = ((Text) natTable.getActiveCellEditor()
                .getEditorControl());
View Full Code Here

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

        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(
                cell.getDataValue()));

        // Set an invalid value in cell - AA
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.