RFR: 8154038: Spinner's converter should update its editor [v2]

Karthik P K kpk at openjdk.org
Thu Mar 16 06:12:27 UTC 2023


On Wed, 15 Mar 2023 12:15:14 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

>> Karthik P K has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address review comments
>
> modules/javafx.controls/src/main/java/javafx/scene/control/Spinner.java line 545:
> 
>> 543:                         value.bind(newFactory.valueProperty());
>> 544:                         // Update the spinner editor when converter is changed.
>> 545:                         newFactory.converterProperty().addListener((o, oldValue, newValue) -> {
> 
> The addition of ChangeListener is fine, but, this newly added ChangeListener should be removed from old valueFactory when `valueFactory` changes.
> Please see the pattern used in `TimelineController` for rateListener.

Updated the code. Please check

> modules/javafx.controls/src/test/java/test/javafx/scene/control/SpinnerTest.java line 1529:
> 
>> 1527:     }
>> 1528: 
>> 1529:     @Test public void testSpinnerEditorUpdateOnConverterChange() {
> 
> It is better to split this test case into two - one for each type of Spinner.

Created separate tests for each type of Spinner. Please check

-------------

PR: https://git.openjdk.org/jfx/pull/1057


More information about the openjfx-dev mailing list