[oXygen-user] extension behaving strangely

Oxygen XML Editor Support support at oxygenxml.com
Fri Mar 30 01:26:18 CDT 2012


Hi Roderick,

The standard way in Java to get a button from a dialog to respond to the 
ENTER key is to make it the default button in the JDialog like:

> JDialog.getRootPane().setDefaultButton(btnSearch);

What exactly is the context of your customization?
Are you implementing your custom Swing dialog and showing it when the 
user performs a certain action in Oxygen?

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 3/29/2012 5:26 PM, Roderik Dernison wrote:
> Hi,
>
> I encounter some strange behaviour in an extension I wrote.
>
> I made a search button respond to the enter key. In Eclipse it responds
> immediately, but in oXygen a user has to use the enter key twice to make
> the extension respond.
>
> I did this to make it work:
>
> btnSearch.registerKeyboardAction(btnSearch.getActionForKeyStroke(KeyStroke./getKeyStroke/(KeyEvent./VK_SPACE/,
> 0, *false*)), KeyStroke./getKeyStroke/(KeyEvent./VK_ENTER/, 0, *false*),
> JComponent./WHEN_IN_FOCUSED_WINDOW/);
>
> btnSearch.registerKeyboardAction(btnSearch.getActionForKeyStroke(KeyStroke./getKeyStroke/(KeyEvent./VK_SPACE/,
> 0, *true*)), KeyStroke./getKeyStroke/(KeyEvent./VK_ENTER/, 0, *true*),
> JComponent./WHEN_IN_FOCUSED_WINDOW/);
>
> btnSearch.addActionListener(*this*);
>
> What should I do to make it respond immediately in oXygen?
>
> Kind regards,
>
> Roderik Dernison
>
>
> ------------------------------------------------------------------------
>
> ----------------------------------------------------------
> Aan dit bericht kunnen geen rechten worden ontleend.
> Het bericht is alleen bestemd voor de geadresseerde.
> Indien het bericht niet voor u is bestemd, verzoeken wij
> u dit aan ons te melden en het bericht te verwijderen.
>
> This message shall not constitute any obligations.
> This message is intended solely for the addressee.
> If you have received this message in error, please
> inform us and delete the message.
> ----------------------------------------------------------
>
>
>
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user


More information about the oXygen-user mailing list