Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how to provide keyboard accelerators for object context menus?
how to provide keyboard accelerators for object context menus? [message #273652] Fri, 08 October 2004 08:14 Go to next message
Eclipse UserFriend
Hi,

I am creating an eclipse plugin which creates a new perspective and
views. These views display tree nodes, and tables which contain objects.

Each of these objects has a context menu associated with it, which work
fine. However I would like to be able to assign keyboard accelerators so
that I can use keyboard shortcuts such as "delete" to delete an object,
rather than having to use right-mouse-button -> delete.

I have used the jface setAccelerator(SWT.DEL) call, which decorates the
context menu to show that delete is the shortcut, but pressing delete
does nothing.

Can anyone offer advice on how I would set these shortcuts to work?

Thank you.
Re: how to provide keyboard accelerators for object context menus? [message #273653 is a reply to message #273652] Fri, 08 October 2004 08:17 Go to previous messageGo to next message
Eclipse UserFriend
Additionally I would like to be able to provide a global keyboard short
cut key to refresh all the data in my views - eg. F5

Any help that people can provide would be much appreciated

Stephen Rowles wrote:
> Hi,
>
> I am creating an eclipse plugin which creates a new perspective and
> views. These views display tree nodes, and tables which contain objects.
>
> Each of these objects has a context menu associated with it, which work
> fine. However I would like to be able to assign keyboard accelerators so
> that I can use keyboard shortcuts such as "delete" to delete an object,
> rather than having to use right-mouse-button -> delete.
>
> I have used the jface setAccelerator(SWT.DEL) call, which decorates the
> context menu to show that delete is the shortcut, but pressing delete
> does nothing.
>
> Can anyone offer advice on how I would set these shortcuts to work?
>
> Thank you.
Re: how to provide keyboard accelerators for object context menus? [message #273692 is a reply to message #273652] Fri, 08 October 2004 16:06 Go to previous message
Eclipse UserFriend
Originally posted by: douglas.pollock.magma.ca

Stephen Rowles wrote:
> Each of these objects has a context menu associated with it, which work
> fine. However I would like to be able to assign keyboard accelerators so
> that I can use keyboard shortcuts such as "delete" to delete an object,
> rather than having to use right-mouse-button -> delete.
>
> Can anyone offer advice on how I would set these shortcuts to work?

partSite.getKeyBindingService.registerAction(deleteAction);



cheers,
d.
Previous Topic:Compile time and Compile warnings
Next Topic:[JFace] How to query keys / images used by JFace itself
Goto Forum:
  


Current Time: Tue Sep 16 04:27:34 EDT 2025

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

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

Back to the top