Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to use IElementUpdater
https://www.eclipse.org/forums/index.php/mv/msg/440337/986253/#msg_986253
I have an editor with a context menu. This menu contains a command. I would like to change the command label in that menu based on the editor's selection, so my handler for that command implements IElementUpdater.
The problem is that the IElementUpdater.update() is not called until the handler is first executed. This is because eclipse wraps the handler into HandlerProxy object.
It swallows all update calling until the real handler is loaded (when first time executed).
How can I force the HandlerProxy load my handler?? Is there any other workaround for this?
Thanks]]>Jan Krakora2012-11-19T16:15:54-00:00Re: How to use IElementUpdater
https://www.eclipse.org/forums/index.php/mv/msg/440337/986310/#msg_986310
I would suggest you to use a dynamic menuContribution and use a subclass of a org.eclipse.ui.actions.CompoundContributionItem for it.
Inside that CompoundContributionItem you could build a org.eclipse.ui.menus.CommandContributionItem with your desired label.
Best regards,
Simon]]>Simon Scholz2012-11-19T20:52:07-00:00Re: How to use IElementUpdater
https://www.eclipse.org/forums/index.php/mv/msg/440337/986383/#msg_986383
Jan Krakora2012-11-20T10:01:28-00:00