I have a TableViewer with data that can be edited via CheckboxCellEditor.

My code is very similar to the following example code at java2s.com: new ComboBoxCellEditor.

If you run that code, create a new person and the click in the "Age Range" cell of the entry you can see a text editor, however I would expect the combo box to be opened. The used CheckboxCellEditor is already defined to be SWT.READ_ONLY but that does not help. I also tried to replace it with an CheckboxViewerCellEditor or add SWT.DROP_DOWN but this all does not help.

How can I create a combo box cell editor that directly displays the list of values upon first mouse click?

有帮助吗?

解决方案

Looks like you can call setActivationStyle on the ComboBoxCellEditor to set what happens on activation:

cellEditor.setActivationStyle(ComboBoxCellEditor.DROP_DOWN_ON_KEY_ACTIVATION | ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top