Eclipse menu : update command state [message #651703] |
Tue, 01 February 2011 11:09 |
Nicolas Guyomar Messages: 29 Registered: February 2010 Location: Nantes (France) |
Junior Member |
|
|
Hi everyone,
I have been using commands/handlers to build menus in an editor and a view following http://wiki.eclipse.org/Menu_Contributions
I have extended org.eclipse.ui.edit.delete and org.eclipse.ui.edit.copy in order to implement my own handlers.
Those handlers work perfectly fine with keyBinding or within a contextual menu, the handler isEnabled() method is called.
The problem I'm facing is that the Eclipse main menu Edit>Delete and Edit>Copy is not updated when my selection changes.
If I want it to be updated, I need to select an element in my editor, give the focus to an other one and give the focus back to my editor. This way the handler isEnabled() method is called and the Edit menu is updated.
I feel like I should fire an event when my selection changes so that the Worbench would know he has to update its menu, but I do not know how to fire it, or from where ?
I hope my problem description is clear enought
Regards
Nicolas Guyomar
--
http://www.eclipse.org/MoDisco/
http://www.eclipse.org/modeling/emft/facet/
Nicolas Guyomar
http://www.eclipse.org/MoDisco/
http://www.eclipse.org/modeling/emft/facet/
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04185 seconds