KeyBindings in RAP [message #729579] |
Mon, 26 September 2011 10:54  |
Eclipse User |
|
|
|
I have a lot of actions in my RAP application (menu actions, context menu actions. other actions) for which I need to add keyboard shortcuts. These have been added by defining keybindings in my manifest using 'org.eclipse.ui.binding', All of these were working in my RCP version of the application, but in RAP they don't.
So, I used the following code to add my key bindings :
display.setData(RWT.ACTIVE_KEYS,new String[]{"My key combination -Ex CTRL+F11"});
display.addFilter(SWT.KeyDown, new Listener() {
public void handleEvent(Event event) {
// Invoke action here
}
});
This works as expected.
I want to know is if there's an easier/non-programmatic way to do it. Because this way of doing it is quite tedious, given the number of actions I need to register.
|
|
|
Re: KeyBindings in RAP [message #729696 is a reply to message #729579] |
Mon, 26 September 2011 15:14   |
Eclipse User |
|
|
|
Hi,
the 'org.eclipse.ui.binding' extension point should work in RAP too. If
not, please file a bugzilla with a simple project to reproduce it.
Thanks,
Ivan
On 9/26/2011 5:54 PM, amandeep.chahal wrote:
> I have a lot of actions in my RAP application (menu actions, context
> menu actions. other actions) for which I need to add keyboard
> shortcuts. These have been added by defining keybindings in my
> manifest using 'org.eclipse.ui.binding', All of these were working in
> my RCP version of the application, but in RAP they don't.
>
> So, I used the following code to add my key bindings :
> display.setData(RWT.ACTIVE_KEYS,new String[]{"My key combination -Ex
> CTRL+F11"});
> display.addFilter(SWT.KeyDown, new Listener() {
>
> public void handleEvent(Event event) {
> // Invoke action here
> }
> });
>
> This works as expected. I want to know is if there's an
> easier/non-programmatic way to do it. Because this way of doing it is
> quite tedious, given the number of actions I need to register.
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04746 seconds