开发者

How to update the list of items in the SWT Combo box?

开发者 https://www.devze.com 2023-04-04 21:11 出处:网络
I have a U开发者_如何学PythonI with a Combo box. The list of items, which can be chosen, has to be refreshed every time the combo is about to open the list.

I have a U开发者_如何学PythonI with a Combo box. The list of items, which can be chosen, has to be refreshed every time the combo is about to open the list.

Is there any way - i.e. to add a listener which will inform UI that Combo is about to open?

Unfortunately I am not able to observe model to update the list when it changes.


Unfortunatelly there is no such method for SWT Components. In Swing it would be easy with the help of the PopupMenuListener Interface.
A workaround I can think of would be to implement a MouseListener and a KeyboardListener (As Comboboxes can be opened by pressing 'space') so you can at least update your Combobox List when those two Events take place.

0

精彩评论

暂无评论...
验证码 换一张
取 消