Object initialCanonicalValue, final IConfigRegistry configRegistry) {
try {
// determine the position of the cell to put into edit mode
Rectangle cellBounds = cell.getBounds();
ILayer layer = cell.getLayer();
int columnPosition = cell.getColumnPosition();
int rowPosition = cell.getRowPosition();
// read the configuration for the specified cell for
// - which editor to use for that cell
final List<String> configLabels = cell.getConfigLabels()
.getLabels();
// check which editor to use
final ICellEditor cellEditor = configRegistry.getConfigAttribute(
EditConfigAttributes.CELL_EDITOR, DisplayMode.EDIT,
configLabels);
if (cellEditor.openInline(configRegistry, configLabels)) {
// edit inline
ICellEditHandler editHandler = new InlineEditHandler(layer,
columnPosition, rowPosition);
Rectangle editorBounds = layer.getLayerPainter()
.adjustCellBounds(
columnPosition,
rowPosition,
new Rectangle(cellBounds.x, cellBounds.y,
cellBounds.width, cellBounds.height));
cellEditor.activateCell(parent, initialCanonicalValue,
EditModeEnum.INLINE, editHandler, cell, configRegistry);
final Control editorControl = cellEditor.getEditorControl();
editorBounds = cellEditor.calculateControlBounds(editorBounds);
if (editorControl != null && !editorControl.isDisposed()) {
editorControl.setBounds(editorBounds);
// We need to add the control listeners after setting the
// bounds to it
// because of the strange behaviour on Mac OS where a
// control loses focus
// if its bounds are set
cellEditor.addEditorControlListeners();
layer.fireLayerEvent(new CellEditorCreatedEvent(cellEditor));
}
} else {
List<ILayerCell> cells = new ArrayList<ILayerCell>();
cells.add(cell);
editCells(cells, parent, initialCanonicalValue, configRegistry);