문제

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