Setting context menu on editable CCombo [message #465589] |
Thu, 15 December 2005 11:10  |
Eclipse User |
|
|
|
How can I add a context menu to an editable CCombo??
The following standard way doesn't work:
CCombo combo = .....; //Creating the editable combo
MenuManager menuManager = new MenuManager("#PopUpMenu");
menuManager.setRemoveAllWhenShown(true);
menuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
manager.add(new SearchAction(combo, group, parent.getShell())); // the
self written action
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS +
"-end"));
}
});
Menu menu = menuManager.createContextMenu(combo);
combo.setMenu(menu);
The problem is that the menu from the underlying text field of the combo
will be shown instead the menu set on the combo.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03763 seconds