Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to use IElementUpdater
How to use IElementUpdater [message #986253] Mon, 19 November 2012 16:15 Go to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi,

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
Re: How to use IElementUpdater [message #986310 is a reply to message #986253] Mon, 19 November 2012 20:52 Go to previous messageGo to next message
Simon Scholz is currently offline Simon ScholzFriend
Messages: 73
Registered: April 2012
Location: Germany
Member
Hello Jan,

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
Re: How to use IElementUpdater [message #986383 is a reply to message #986310] Tue, 20 November 2012 10:01 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Amazing, thanks a lot!
Previous Topic:Prodouct files all my icons are gone
Next Topic:Database layer via ExtensionPoint, classloading issues
Goto Forum:
  


Current Time: Fri Apr 19 13:46:27 GMT 2024

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

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

Back to the top