Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Accessing the menu manager(Need to update the menus when an editor gains focus.)
Accessing the menu manager [message #498023] Fri, 13 November 2009 17:21
dwain Missing name is currently offline dwain Missing nameFriend
Messages: 35
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 in the editors setFocus() method.
		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.


[Updated on: Fri, 13 November 2009 17:27]

Report message to a moderator

Previous Topic:pde.visualization.dependency
Next Topic:Accessing the menu manager
Goto Forum:

Current Time: Sat Aug 08 18:16:38 GMT 2020

Powered by FUDForum. Page generated in 0.02135 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top