|
Re: Intercept mnemonic [message #1181247 is a reply to message #1173139] |
Mon, 11 November 2013 13:26 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
I'm not sure what widget your "MLabel" is, but the best way I can think
of to get this working (assuming to use RAP 2.2) is to attach a FocusIn
ClientListener to that widget and focus the next widget in that Listener.
This might help:
http://eclipse.org/rap/developers-guide/devguide.php?topic=scripting.html&version=2.2#js-api
Here is an example for something similar (changing focus by typing):
http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.clientscripting.git/tree/bundles/org.eclipse.rap.clientscripting.demo/src/org/eclipse/rap/clientscripting/demo/FocusSwitch.js
Note that you only need to register a key to attach the "next" widget to
once per UI session (WidgetUtil.registerDataKeys) and create the
ClientListener once per UI session. After that you only need to attach
the listener and "next" widget to each of your "MLabel" widgets.
Greetings,
Tim
Am 06.11.2013 11:09, schrieb Matthias Nick:
> Hi,
> I have got another question regarding mnemonics in RAP: In general they
> work fine, e.g. if the label is next to the textfield. However, I have a
> special case to consider:
>
>
> +------------+ +------+ +------------------------------+
> + &Text + + * + + +
> +------------+ +------+ +------------------------------+
> Label MLabel TextField
>
>
> Between the Label and the TextField is another label (MLabel) that means
> that when I press "alt+t", TextField will not get the focus. In SWT I
> have solved this problem by adding a new TraverseListener and waiting
> for SWT.TRAVERSE_MNEMONIC. However, I have seen that my TraverseListener
> is never called and RAP does not support SWT.TRAVERSE_MNEMONIC.
>
> Do you guys see any way I can intercept the mnemonic hit and implement
> my own custom logic?
>
> Thank you very much,
> Matthias
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03143 seconds