Author: oriol
Date: 2012-04-13 02:20:39 -0700 (Fri, 13 Apr 2012)
New Revision: 28820

Modified:
   
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/TaskDialog.java
Log:
Another fix for issue #780 with modification to make it work on Mac OS too

Modified: 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/TaskDialog.java
===================================================================
--- 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/TaskDialog.java
        2012-04-13 00:20:21 UTC (rev 28819)
+++ 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/task/TaskDialog.java
        2012-04-13 09:20:39 UTC (rev 28820)
@@ -60,6 +60,8 @@
 import javax.swing.SwingUtilities;
 import javax.swing.Timer;
 import javax.swing.UIManager;
+import javax.swing.InputMap;
+import javax.swing.KeyStroke;
 
 class TaskDialog extends JDialog {
 
@@ -255,7 +257,7 @@
 
        void initComponents() {
                //Set the button that has focus as default button. Thereby, 
enter key will activate that button.
-               UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
+               //UIManager.put("Button.defaultButtonFollowsFocus", 
Boolean.TRUE);
                initTextArea(descriptionLabel);
                initTextArea(descriptionLabel2);
                initTextArea(statusLabel);
@@ -271,6 +273,11 @@
                                cancel();
                        }
                });
+               
+               //Patch to make sure key enter is working on the focus button 
for any OS
+               InputMap im = (InputMap)UIManager.get("Button.focusInputMap");
+           im.put( KeyStroke.getKeyStroke( "ENTER" ), "pressed" );
+           im.put( KeyStroke.getKeyStroke( "released ENTER" ), "released" );
 
                setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                addWindowListener(new WindowAdapter() {

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to