|Accessing the menu manager [message #603307]
||Fri, 13 November 2009 17:21
| dwain Missing name
Registered: October 2009
I need to be able to update the menus when an editor gains focus. I am able to do that with the following discouraged access.|
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if(window instanceof WorkbenchWindow)
MenuManager menuManager = ((WorkbenchWindow)window).getMenuManager();
However I don't like using the discouraged access, so I am hoping that there is a better way to access the MenuManager or that someone might be able to show me how to do it in the extension manager.
I need to have some commands disabled depending on a variable that is in the editor input. Right now I have some definitions that disable them if it is the wrong type of editor, but not sure how I can get at a variable that is in the editors input in that way. Thank you for the help.
Powered by FUDForum
. Page generated in 0.01282 seconds