Accessing the menu manager [message #498023] |
Fri, 13 November 2009 17:21 |
dwain Missing name Messages: 35 Registered: October 2009 |
Member |
|
|
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 in the editors setFocus() method.
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if(window instanceof WorkbenchWindow)
{
MenuManager menuManager = ((WorkbenchWindow)window).getMenuManager();
menuManager.update(IAction.TEXT);
}
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.
Dwain
[Updated on: Fri, 13 November 2009 17:27] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02839 seconds