label update for command/handler/contribution [message #323701] |
Sun, 06 January 2008 18:06  |
Eclipse User |
|
|
|
Hi,
for "old" retargetable actions, there were the option allowLabelUpdate and
an action could set another label for its menu item (as example).
Is there a similar function for the new menu contribution mechanism
(org.eclipse.ui.menus) and command handlers? So, that the active handler can
add additional info to its menu item label?
Thanks,
Teddy
|
|
|
|
|
|
Re: label update for command/handler/contribution [message #324345 is a reply to message #323955] |
Wed, 23 January 2008 05:53   |
Eclipse User |
|
|
|
Hi Paul,
It is a toolbar button and the default handler. The handler object is
created and the method #isEnabled() is called via HandlerProxy#isEnabled() .
It seems, it is not updated, after the proxy loaded the real handler?
Ciao,
Teddy
"Paul Webster" <pwebster@ca.ibm.com> schrieb im Newsbeitrag
news:fmg6ko$b0a$2@build.eclipse.org...
> Teddy Walker wrote:
>> Paul,
>> thank you very much! That's what I was looking for.
>> I works fine, but on startup. It is not updated automatically, calling
>> refreshElements in constructor of the handler is too early. As
>> workaround, I call it on first request of isEnabled. Is it a bug?
>
> On startup your handler would not normally be loaded, but it would be
> proxied (probably by a HandlerProxy). If your handler was the default
> handler it would be the active handler.
>
> If you are worried that the menu item is not being updated right away,
> that is normal (since your handler won't be loaded until a user action).
>
> Or is it a slightly different scenario than I outline here?
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
> http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.30835 seconds