RFR: 8265206: Tree-/TableCell: editing state not updated on cell re-use

Jeanette Winzenburg fastegal at openjdk.java.net
Wed Apr 21 14:41:37 UTC 2021


On Wed, 21 Apr 2021 14:07:21 GMT, Johan Vos <jvos at openjdk.org> wrote:

>> Issue is missing update of Tree-/TableCell's editiable state when changing its index from editingIndex to -1. 
>> 
>> Seems to be a left-over from fixing cell's editing update - done in [JDK-8150525](https://bugs.openjdk.java.net/browse/JDK-8150525) - on index change for the special case of new index -1.
>> 
>> Fixed by cleaning out editing state in that corner case also, added tests that were failing before and passing after the fix. Note that there are also tests that passed before: the previous fix didn't add any tests, so added them here.
>
> modules/javafx.controls/src/main/java/javafx/scene/control/TableCell.java line 581:
> 
>> 579:         // so that subclasses which override cancelEdit can execute. So,
>> 580:         // I have to use a kind of hacky flag workaround.
>> 581:         updateEditingIndex = false;
> 
> Do you need to assert on updateEditingIndex being true before this is done?

hmm .. don't quite understand your comment: it's a flag to tell cancelEdit to not update control's editing state (that whole block is simply extracted from the pre-fix state .. where it has been for ages ;) So the answer is most probably no :)

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

PR: https://git.openjdk.java.net/jfx/pull/473


More information about the openjfx-dev mailing list