[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: JComboBox
From: |
David Gilbert |
Subject: |
[cp-patches] FYI: JComboBox |
Date: |
Tue, 13 Sep 2005 14:34:02 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050728) |
I committed this patch (and am about to put the corresponding tests into Mauve):
2005-09-13 David Gilbert <address@hidden>
* javax/swing/JComboBox.java
(getPrototypeDisplayValue): added API docs,
(setPrototypeDisplayValue): fire property change event.
Regards,
Dave Gilbert
Index: javax/swing/JComboBox.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComboBox.java,v
retrieving revision 1.18
diff -u -r1.18 JComboBox.java
--- javax/swing/JComboBox.java 27 Jul 2005 12:41:33 -0000 1.18
+++ javax/swing/JComboBox.java 13 Sep 2005 13:27:46 -0000
@@ -551,14 +551,37 @@
return -1;
}
+ /**
+ * Returns an object that is used as the display value when calculating the
+ * preferred size for the combo box. This value is, of course, never
+ * displayed anywhere.
+ *
+ * @return The prototype display value (possibly <code>null</code>).
+ *
+ * @since 1.4
+ * @see #setPrototypeDisplayValue(Object)
+ */
public Object getPrototypeDisplayValue()
{
return prototypeDisplayValue;
}
- public void setPrototypeDisplayValue(Object newPrototypeDisplayValue)
+ /**
+ * Sets the object that is assumed to be the displayed item when calculating
+ * the preferred size for the combo box. A address@hidden
PropertyChangeEvent} (with
+ * the name <code>prototypeDisplayValue</code>) is sent to all registered
+ * listeners.
+ *
+ * @param value the new value (<code>null</code> permitted).
+ *
+ * @since 1.4
+ * @see #getPrototypeDisplayValue()
+ */
+ public void setPrototypeDisplayValue(Object value)
{
- prototypeDisplayValue = newPrototypeDisplayValue;
+ Object oldValue = prototypeDisplayValue;
+ prototypeDisplayValue = value;
+ firePropertyChange("prototypeDisplayValue", oldValue, value);
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] FYI: JComboBox,
David Gilbert <=