Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How do u add a mnuemonic to the MenuItem ?
How do u add a mnuemonic to the MenuItem ? [message #436610] Wed, 14 September 2005 05:34 Go to next message
Eclipse UserFriend
Originally posted by: gkurien.icope.com

i have used menuItem.setAccelerator( SWT.CTRL | 'N');

Now i want to display CTRL+N on the menuItem ...How do i do it ?
Re: How do u add a mnuemonic to the MenuItem ? [message #436656 is a reply to message #436610] Wed, 14 September 2005 08:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kevin.cs.washington.edu

Genu George wrote:
>
> i have used menuItem.setAccelerator( SWT.CTRL | 'N');
>
> Now i want to display CTRL+N on the menuItem ...How do i do it ?
>
I'm not sure how to do it, but I know how you can find out.

In Eclipse go to new-project-plugin project-rcp-mail app.

Look at the 'File' menu in the mail app after you run it.
Re: How do u add a mnuemonic to the MenuItem ? [message #436658 is a reply to message #436656] Wed, 14 September 2005 10:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gkurien.icope.com

i did see that but there we specify each command that i use in the RCP
application and the bind it with the key ...

if i dint make use of the xml file to create my action then how do i get
it done ?
Re: How do u add a mnuemonic to the MenuItem ? [message #436669 is a reply to message #436658] Wed, 14 September 2005 13:57 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
You include it in your MenuItem.setText() invocation, separated by a '\t',
for example:

menuItem.setText("&New\tCtrl+N");

Grant

"Genu George" <gkurien@icope.com> wrote in message
news:3c6160cae6accaa4e5d04c4d1248ad46$1@www.eclipse.org...
>
> i did see that but there we specify each command that i use in the RCP
> application and the bind it with the key ...
>
> if i dint make use of the xml file to create my action then how do i get
> it done ?
>
Re: How do u add a mnuemonic to the MenuItem ? [message #437013 is a reply to message #436669] Tue, 20 September 2005 12:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gkurien.icope.com

thanx it works...

but why does it work for some and not work for the others....?
Re: How do u add a mnuemonic to the MenuItem ? [message #437023 is a reply to message #437013] Tue, 20 September 2005 14:57 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
It should always work. Which platform are you running on? Do you have a
snippet that shows it not consistently working for you? Is it some specific
type of menu item (eg.- CASCADE, RADIO, etc.) that this does not work for?

http://eclipse.org/swt/faq.php#whatisasnippet

Grant

"Genu George" <gkurien@icope.com> wrote in message
news:6dbca74016019ca9d94fea26f4e17e40$1@www.eclipse.org...
> thanx it works...
>
> but why does it work for some and not work for the others....?
>
>
Re: How do u add a mnuemonic to the MenuItem ? [message #437048 is a reply to message #437023] Wed, 21 September 2005 09:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gkurien.icope.com

I Think it works for some specific letters...

i am using all this in the file menuPath when i write

Action saveAction = new saveAction( "&Save\tCTRL+S", "MY_ID"); it does
not work
but when i write the same code with a differnt letter ie

Action saveAction = new SaveAction( "&Save\tCTRL+D", "MY_ID"); it works !!

the only thing i have changed is 'CTRL+[S]' to 'CTRL+[D]'

i am using eclipse 3.1 and i am not using a MenuItem directly
Re: How do u add a mnuemonic to the MenuItem ? [message #437052 is a reply to message #437048] Wed, 21 September 2005 13:50 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I think it's conflicting with another accelerator, presumedly in the same
menu.

I just did an experiment where I changed eclipse's File->Close accelerator
from Ctrl+W to Ctrl+P (via org.eclipse.ui's plugin.xml file), and this made
the Ctrl+P accelerator text on the File->Print item disappear as well. So
it appears to be some pre-processing that is done by eclipse before setting
accelerator texts into MenuItems.

Grant

"Genu George" <gkurien@icope.com> wrote in message
news:7f4eb92af10de685e67b79b524bde45b$1@www.eclipse.org...
>
> I Think it works for some specific letters...
>
> i am using all this in the file menuPath when i write
>
> Action saveAction = new saveAction( "&Save\tCTRL+S", "MY_ID"); it does
> not work
> but when i write the same code with a differnt letter ie
>
> Action saveAction = new SaveAction( "&Save\tCTRL+D", "MY_ID"); it works !!
>
> the only thing i have changed is 'CTRL+[S]' to 'CTRL+[D]'
>
> i am using eclipse 3.1 and i am not using a MenuItem directly
>
Re: How do u add a mnuemonic to the MenuItem ? [message #437235 is a reply to message #437052] Mon, 26 September 2005 05:45 Go to previous message
Eclipse UserFriend
Originally posted by: gkurien.icope.com

so does that mean i cant use my mneomonics like i want right now !!!
Previous Topic:Missing customized icon in program launcher
Next Topic:History menu
Goto Forum:
  


Current Time: Sun Dec 08 18:51:05 GMT 2024

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

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

Back to the top