harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r751364 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/JComboBox.java test/api/java.injected/javax/swing/JComboBoxTest.java
Date Sun, 08 Mar 2009 04:33:08 GMT
Author: ndbeyer
Date: Sun Mar  8 04:33:08 2009
New Revision: 751364

URL: http://svn.apache.org/viewvc?rev=751364&view=rev
Log:
Resolve differences between HARMONY-1533 and HARMONY-5873. Changed behavior to follow RI and
throw event when selection doesn't change; changed tests to assert this.

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JComboBoxTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java?rev=751364&r1=751363&r2=751364&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComboBox.java
Sun Mar  8 04:33:08 2009
@@ -336,6 +336,9 @@
                 dataModel.setSelectedItem(element);
             } else if (isEditable && element != null && !element.equals(getEditor().getItem()))
{
                 getEditor().setItem(element);
+            } else {
+                // fire action event even if selection is not changed
+                fireActionEvent();
             }
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JComboBoxTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JComboBoxTest.java?rev=751364&r1=751363&r2=751364&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JComboBoxTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java.injected/javax/swing/JComboBoxTest.java
Sun Mar  8 04:33:08 2009
@@ -202,11 +202,7 @@
         assertEquals("b", comboBox.getSelectedItem());
         comboBox.setSelectedItem("b");
         assertTrue(itemController.getEvents().isEmpty());
-        if (isHarmony()) {
-            assertNull(actionController.getEvent());
-        } else {
-            assertNotNull(actionController.getEvent());
-        }
+        assertNotNull(actionController.getEvent());
         actionController.reset();
         itemController.reset();
         comboBox.setEditable(false);
@@ -221,11 +217,7 @@
         assertEquals(1, comboBox.getSelectedIndex());
         comboBox.setSelectedItem("b");
         assertEquals(1, comboBox.getSelectedIndex());
-        if (isHarmony()) {
-            assertNull(actionController.getEvent());
-        } else {
-            assertNotNull(actionController.getEvent());
-        }
+        assertNotNull(actionController.getEvent());
         assertTrue(itemController.getEvents().isEmpty());
         comboBox.setSelectedItem("a");
         assertEquals("a", comboBox.getSelectedItem());



Mime
View raw message