[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: JComboBox fixes
From: |
David Gilbert |
Subject: |
[cp-patches] FYI: JComboBox fixes |
Date: |
Tue, 18 Oct 2005 17:44:20 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050728) |
This patch fixes some failing Mauve tests:
2005-10-18 David Gilbert <address@hidden>
* javax/swing/JComboBox.java
(setModel): update the selectedItemReminder field,
(selectedItemChanged): only send ItemEvent.SELECTED event if the new
selection is non-null.
Regards,
Dave
Index: javax/swing/JComboBox.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComboBox.java,v
retrieving revision 1.21
diff -u -r1.21 JComboBox.java
--- javax/swing/JComboBox.java 12 Oct 2005 12:38:20 -0000 1.21
+++ javax/swing/JComboBox.java 18 Oct 2005 16:36:35 -0000
@@ -311,7 +311,8 @@
// Stores old data model for event notification.
ComboBoxModel oldDataModel = dataModel;
dataModel = newDataModel;
-
+ selectedItemReminder = newDataModel.getSelectedItem();
+
// Notifies the listeners of the model change.
firePropertyChange("model", oldDataModel, dataModel);
}
@@ -901,8 +902,9 @@
// Fire ItemEvent to indicate that new item is selected
Object newSelection = getSelectedItem();
- fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
- newSelection, ItemEvent.SELECTED));
+ if (newSelection != null)
+ fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
+ newSelection, ItemEvent.SELECTED));
// Fire Action Event to JComboBox's registered listeners
fireActionEvent();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: JComboBox fixes,
David Gilbert <=