Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Binding label from command addition
Binding label from command addition [message #325676] Mon, 25 February 2008 16:38 Go to next message
Ben Brown is currently offline Ben BrownFriend
Messages: 3
Registered: July 2009
Junior Member
In switching over some menus to commands I came across the following
problem

I have a popup menu contribution that I've added through the
org.eclipse.ui.menus extension point, to which I have attached a command.
Adding this command allowed me to declare icons and a label for the
command on the menu. It also picked up at runtime that the command had an
associated binding so it added that to the menu item as well.

Picking up the bindings is certainly a great feature but the problem I'm
having is I don't like the label Eclipse decided to use for that binding.

In my case I'm running on Windows Vista on a US - English locale, the
binding is to 'DEL' which is then displayed as 'Delete' on the menu. Is
there a way to change this display for the binding? There doesn't appear
to be anything on the bindings extension point to support an
internationalized label.

Any help would be much appreciated.

Thanks!
Re: Binding label from command addition [message #325681 is a reply to message #325676] Mon, 25 February 2008 16:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Ben,

My keyboard calls the key Delete in one place and "Del" in another (as
with Insert and Ins). I believe all these will appear in a .properties
file somewhere and would be translated if you had the translation
fragments installed (which aren't available for Eclipse 3.3). Generally
translation is done by using %<key> in the plugin.xml, specifying
Bundle-Localization: plugin in the MANIFEST.MF, and the defining that
<key> in plugin.properties.

Ben Brown wrote:
> In switching over some menus to commands I came across the following
> problem
>
> I have a popup menu contribution that I've added through the
> org.eclipse.ui.menus extension point, to which I have attached a
> command. Adding this command allowed me to declare icons and a label
> for the command on the menu. It also picked up at runtime that the
> command had an associated binding so it added that to the menu item as
> well.
> Picking up the bindings is certainly a great feature but the problem
> I'm having is I don't like the label Eclipse decided to use for that
> binding.
>
> In my case I'm running on Windows Vista on a US - English locale, the
> binding is to 'DEL' which is then displayed as 'Delete' on the menu.
> Is there a way to change this display for the binding? There doesn't
> appear to be anything on the bindings extension point to support an
> internationalized label.
>
> Any help would be much appreciated.
>
> Thanks!
>
Re: Binding label from command addition [message #325693 is a reply to message #325681] Mon, 25 February 2008 17:19 Go to previous messageGo to next message
Ben Brown is currently offline Ben BrownFriend
Messages: 3
Registered: July 2009
Junior Member
Yeah, thats exactly what I'm looking for for the ui.bindings extension
point. However, a label isn't defined for bindings in the schema.

I'm currently using the method you specified for internationalizing my
labels for the command additions to the menus, it's just those pesky
bindings that are still eluding me.

It's also quite possible, like you said, that the internationalization is
already defined for the DEL sequence somewhere down in the platform code
(like it does for M1 translating to Ctrl on Windows). In which case I'd
probably have to bite the bullet and stick with 'Delete', or log a bug I
guess.
Re: Binding label from command addition [message #325709 is a reply to message #325676] Mon, 25 February 2008 18:24 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

In JFace I think it's about platform, not language ... and there's a
good chance it's getting its information from
/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/forma tting/AbstractKeyFormatter.properties

That's where I see a map from DEL to Delete, but that's also a resource
bundle AFAICT.

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


Re: Binding label from command addition [message #325713 is a reply to message #325709] Mon, 25 February 2008 18:43 Go to previous message
Ben Brown is currently offline Ben BrownFriend
Messages: 3
Registered: July 2009
Junior Member
Ah, yep, looks like thats it, stuck with 'Delete' it is then.

Thanks Paul
Previous Topic:setSelection() in Virtual Table misbehaves
Next Topic:I want a part like the VE's palette
Goto Forum:
  


Current Time: Sat Dec 21 16:08:37 GMT 2024

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

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

Back to the top