Added menuitem doesn't showup [message #45274] |
Fri, 23 May 2003 11:42 |
Taeke Kooiker Messages: 8 Registered: July 2009 |
Junior Member |
|
|
I have to create menu's in the menubar which are not known at design time
(menunames and itemnames are received from another thread which
communicates with an external program). Using the following code I can
create the menuname and 1 item in it, but next time I use this function
the new menuitem will not be added (at least it doesn't show up). Any help
is appreciated.
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IMenuManager parentMenu =
getEditorSite().getActionBars().getMenuManager();
IMenuManager m = parentMenu.findMenuUsingPath(str0);
if (m == null) {
m = new MenuManager(str0, str0);
parentMenu.add(m);
parentMenu.update(true);
}
m.add(new AddMetaEditorAction(str0, str1));
m.update(true);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02736 seconds