The short answer is no. Neither Combo
nor CCombo
allow to flag items as unselectable.
But it should be possible to implement a custom combo widget that can show unselectable items with reasonable effort.
If you look into the CCombo
code you will see that it is not a native widget but composed of other SWT widgets. It uses a List
as the drop-down control to display the items.
If you use a ScrolledCompposite
for the drop-down widget, you could place Label
s therein to represent items. Unselectable items wouldn't require extra work. For selectable items, you could use mouse listeners for the Label
s to highlight them when hovered and to handle selection.
If you plan to show a large number of items (which you shouldn't anyway in a combo box), the number of created labels may have a performance impact.
Alternatively, you may want to try the Nebula TableCombo. Possibly the table can be tweaked to show some items as unselectable (using custom-drawn items) and the selection behavior can be disabled for those.