[cp-patches] FYI: JComboBox fixes

Roman Kennke roman at kennke.org
Sun Jan 7 21:14:08 UTC 2007


Hi Mark,

> On Sat, 2007-01-06 at 16:44 +0100, Roman Kennke wrote:
> > This fixes one weird NPE (see associated bug report) and I also cleaned
> > up some inconsistencies that I came over and some warnings that Eclipse
> > came over :-)
> > 
> > 2007-01-06  Roman Kennke  <roman at kennke.org>
> > 
> > 	PR 30337
> > 	* javax/swing/plaf/basic/BasicComboBoxUI.java
> > 	(installUI): Install popup and list here.
> > 	Don't configure the arrow button and editor here.
> > 	(installComponents): Don't install popup and list here. (Moved
> > 	to installUI). Configure arrow button here and check for null.
> > 	(addEditor): Configure editor here.
> > 	(configureArrowButton): Directly fetch listeners from popup.
> > 	(paintCurrentValue): Removed unused local variables.
> > 	(layoutContainer): Removed unused local variables.
> > 	(PropertyChangeHandler.propertyChange): Don't invalidate minimumSize
> > 	on each property change. Avoid calling getPropertyName() repeatedly.
> > 	Clean up. Call addEditor() when editor changes. Configure and
> > 	unconfigure editor when editable changes. Use 'model' instead
> > 	of non-existing 'dataModel' property.
> > 	* javax/swing/plaf/basic/BasicComboPopup.java
> > 	(uninstallingUI): Remove property change listener and item listener
> > 	here. Uninstall list listeners. Set model to null to prevent leakage.
> > 	(configureList): Don't sync list selection there.
> > 	(uninstallComboBoxListeners): Moved to uninstallingUI.
> > 	(uninstallListeners): Moved to uninstallingUI.
> > 	* javax/swing/plaf/metal/MetalComboBoxUI.java
> > 	(createPopup): Call super.
> > 	(getMinimumSize): Removed unused statement.
> 
> Could you take a look at the following Mauve regressions caused by this
> patch?
> 
> FAIL: javax.swing.JComboBox.setEditor
> FAIL: javax.swing.plaf.basic.BasicComboBoxUI.general
> FAIL: javax.swing.plaf.basic.BasicComboBoxUI.getDefaultSize
> FAIL: javax.swing.plaf.basic.BasicComboBoxUI.getMaximumSize
> FAIL: javax.swing.plaf.basic.BasicComboBoxUI.getMinimumSize
> FAIL: javax.swing.plaf.metal.MetalComboBoxUI.createArrowButton

Thanks for checking. I believe that some of these failures are caused by
an earlier patch (Component.getFont() should _not_ return a default font
as checked by another Mauve test). Anyway, I fixed all these
regressions. I also added a Mauve test for the original bug report. We
are passing them all now and the combo boxes still seem to work.

2007-01-07  Roman Kennke  <roman at kennke.org>

	PR 30337
	* java/awt/Component.java
	(getFontImpl): Return null when the component has no font set
	and also has no parent yet.
	* javax/swing/plaf/basic/BasicComboBoxUI.java
	(PropertyChangeHandler.propertyChange): Only add editor when combo
	box is editable. Avoid fetching the property name repeatedly.
	Invalidate when renderer or prototypeDisplayValue change.
	(uninstallComponents): Unconfigure everything and then remove all
	components.
	* javax/swing/plaf/basic/BasicComboPopup.java
	(uninstallingUI): Don't nullify list model.
	* javax/swing/plaf/metal/MetalComboBoxUI.java
	(createArrowButton): Pass currentValuePane to the MetalComboBoxButton
	constructor rather than a new (unconnected) CellRendererPane.


/Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 9193 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20070107/fd638952/patch.bin


More information about the Classpath-patches mailing list