[Review request] Editable ComboBox / Spinner controls need uniform 'commit on focus lost' semantics

Jonathan Giles jonathan.giles at oracle.com
Fri Jun 17 00:35:51 UTC 2016


Hi all,

Please review my addition of 'commitValue' / 'cancelEdit' APIs to 
Spinner and ComboBox. These APIs mirror the API on TextInputControl, and 
allows for the controls (rather than their skins) to properly commit on 
focus loss.

Previously committing on focus loss was handled by the control skins, 
but because these skins were created after the control was shown in a 
Scene, it was possible (and highly probable) that other listeners would 
be installed on the control before the 'commit-on-focus-loss' listener 
was installed. This would result in situations where listeners got the 
old data.

By adding these additional two methods to Spinner and ComboBox, we can 
prevent this by being the first listener in the queue.

I should note that cancelEdit() is not required for this particular fix, 
but it seemed appropriate to consider its introduction at the same time 
as commitValue().

Jira issue: https://bugs.openjdk.java.net/browse/JDK-8150946
Webrev: http://cr.openjdk.java.net/~jgiles/8150946/

-- 


-- Jonathan



More information about the openjfx-dev mailing list