use of org.eclipse.nebula.widgets.nattable.edit.command.EditCellCommand in project nebula.widgets.nattable by eclipse.
the class EditIntegrationTest method testEditorResize.
@Test
public void testEditorResize() {
this.natTable.enableEditingOnAllCells();
ILayerCell cell = this.natTable.getCellByPosition(4, 4);
this.natTable.doCommand(new EditCellCommand(this.natTable, this.natTable.getConfigRegistry(), cell));
assertEquals(new Rectangle(340, 80, 99, 19), this.natTable.getActiveCellEditor().getEditorControl().getBounds());
this.natTable.doCommand(new ColumnResizeCommand(this.natTable, 2, 110));
assertEquals(new Rectangle(340, 80, 99, 19), this.natTable.getActiveCellEditor().getEditorControl().getBounds());
this.natTable.getActiveCellEditor().getEditorControl().notifyListeners(SWT.FocusOut, null);
// ActiveCellEditor should be closed if a ColumnResizeCommand is
// executed and the editor loses focus
assertNull(this.natTable.getActiveCellEditor());
assertNull(ActiveCellEditorRegistry.getActiveCellEditor());
}
use of org.eclipse.nebula.widgets.nattable.edit.command.EditCellCommand in project nebula.widgets.nattable by eclipse.
the class MouseEditAction method run.
@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)));
}
Aggregations