[kepler-dev] [Bug 5012] highlighted OK button in 'Annimate at runtime ...' menu item does not work.

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Sat May 15 11:18:42 PDT 2010


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=5012

Christopher Brooks <cxh at eecs.berkeley.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cxh at eecs.berkeley.edu

--- Comment #4 from Christopher Brooks <cxh at eecs.berkeley.edu> 2010-05-15 11:18:41 PDT ---
Just to be clear, the problem here is that when a dialog comes up and the 
user immediately hits the "Return/Enter" key, then the expected behavior
is that the highlighted button (usually "OK") will be activated and
the window will close.  This is not the case with a bunch of Ptolemy dialogs,
the user must move the focus (either with the mouse or by tabbing)
to the buttons and then hit "Return/Enter"

I think the problem is with ptolemy.gui.ComponentDialog.
I attached three test cases.
The first one:
http://bugzilla.ecoinformatics.org/attachment.cgi?id=325
uses JOptionPane.  It has a text entry field and when the user
hits return, the window closes.

The second one uses ptolemy.gui.Query and ptolemy.gui.ComponentDialog 
http://bugzilla.ecoinformatics.org/attachment.cgi?id=326
does not close when the user hits return.

However, in the second attachment, if I comment out the Java code that
adds the line entry then code works as expected - hitting return closes
the dialog.

I suspect the problem has to do with focus and the focus of the internal
ptolemy.gui.Query not being passed up to the container ComponentDialog.

In Ptolemy Vergil, File | Save As uses the JFileChooser in ptolemy.gui.Top.
ComponentDialog is not used.

The third attachment: 
http://bugzilla.ecoinformatics.org/attachment.cgi?id=327
embeds a JFileChooser into a ComponentDialog.  This test does work, hitting
return closes the window.  I think the issue is that there is not a
entry widget in the JFileChooser.

It could be that not having the focus be on the buttons is the right thing
in the case of the the second attachment.  For example, if there was a
TextArea to be filled in and the focus was in the TextArea and the user
typed a return, then I'd expect that the TextArea would get the return not
the button.  To try this, add
   query.addTextArea("textArea", "An area", "Elvis");
to the second attachment.

-- 
Configure bugmail: http://bugzilla.ecoinformatics.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the Kepler-dev mailing list