Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Action with different names for toolbar and menu
Action with different names for toolbar and menu [message #437125] Wed, 21 September 2005 21:18 Go to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
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 #437129 is a reply to message #437125] Thu, 22 September 2005 08:18 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Francis Upton IV is currently offline Francis Upton IVFriend
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
>
>


Previous Topic:Use another plugin's functionality
Next Topic:Unhandled event loop exception
Goto Forum:
  


Current Time: Fri Dec 06 17:26:42 GMT 2024

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

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

Back to the top