|
Re: Action with different names for toolbar and menu [message #437129 is a reply to message #437125] |
Thu, 22 September 2005 08:18 |
Eclipse User |
|
|
|
Originally posted by: fleque.users.nospam.sf.net
Hello Francis,
is your Action registered within an actionSet?
If so, you could simply register your Action twice.
Once only defining a menubarPath like "File/New" and giving it the name
"Map". The second one will only be for the toolbar, so you'll only
define a toolbarPath like "additions" and give it the name "New Map".
Hope that helps.
Regards Alex
Francis Upton wrote:
> I have an Action to create a new map.
>
> When it is used in the context of a menu, the menu is File -> New ->
> Map..., so the name of the action is "Map...".
>
> When is it used on the toolbar (using a ToolBarManager), I would like it
> to appear as "New Map".
>
> However, I can't see a way to use different names. I was initially
> encouraged by the ActionContributionItem class, but this does not have
> the support to override the name. I suppose I can pretty easily
> subclass it, and that's what I will do if I don't hear a better solution.
>
> Thanks,
>
> Francis
|
|
|
Re: Action with different names for toolbar and menu [message #437152 is a reply to message #437129] |
Thu, 22 September 2005 23:37 |
Francis Upton IV Messages: 472 Registered: July 2009 Location: Oakland, CA |
Senior Member |
|
|
Thanks Alex,
I don't use ActionSets currently, but I think they would be useful, and
this provides a reason to try them.
Francis
Fleque wrote:
> Hello Francis,
>
> is your Action registered within an actionSet?
> If so, you could simply register your Action twice.
> Once only defining a menubarPath like "File/New" and giving it the name
> "Map". The second one will only be for the toolbar, so you'll only
> define a toolbarPath like "additions" and give it the name "New Map".
> Hope that helps.
>
> Regards Alex
>
>
>
> Francis Upton wrote:
>
>> I have an Action to create a new map.
>>
>> When it is used in the context of a menu, the menu is File -> New ->
>> Map..., so the name of the action is "Map...".
>>
>> When is it used on the toolbar (using a ToolBarManager), I would like
>> it to appear as "New Map".
>>
>> However, I can't see a way to use different names. I was initially
>> encouraged by the ActionContributionItem class, but this does not have
>> the support to override the name. I suppose I can pretty easily
>> subclass it, and that's what I will do if I don't hear a better solution.
>>
>> Thanks,
>>
>> Francis
>
>
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Powered by
FUDForum. Page generated in 0.03341 seconds