Wednesday, October 8, 2014

Eclipse SWT CheckboxCellEditor hangs on Mac OS X

.. when using the wrong value type.

The CheckboxCellEditor requires an Integer as its value, i.e. the index of one of its labels. When instead providing the label text, the SWT event loop will hang on Mac OS X. The combo editor's setValue method has an assertion to check the value type, but this doesn't result in an Exception with normal settings. Instead, the debugger will typically show that the main loop is stuck in handling the mouse-down event which activated the cell editor.

The fix is simply to provide the correct value, but unfortunately the reason of the hangup is not immediately obvious, there is no exception or log message that indicates the wrong value type as the reason for the hangup.