This is a follow-on to JDK-8089913 that was discovered during the code review.
TreeCell and TreeTableRow are constructed with a null TreeItem, and no pseudo-class state for "collapsed" or "expanded". An item is set on a cell, will correctly update the pseudo-class state to set exactly one of "collapsed" or "expanded". Setting the item back to null will not remove the previously set pseudo-class. This should probably be changed to either:
A. remove any pseudoclass when the item is set to null, or
B. set the :collapsed pseudoclass and remove the :expanded pseudoclass when the item is set to null.
I don't know whether it matters in practice, since an application doesn't directly manage the creation of the cells (other than by providing a cell factory) or setting the item. The pseudo-class state of the cell is a proxy for the item it points to. Ideally, it would only contain the "empty" state if the item is null, but given that such a cell would never be rendered it would be hard to point to something that doesn't work as a result.
See the discussion in https://git.openjdk.java.net/jfx/pull/413 for more information.
TreeCell and TreeTableRow are constructed with a null TreeItem, and no pseudo-class state for "collapsed" or "expanded". An item is set on a cell, will correctly update the pseudo-class state to set exactly one of "collapsed" or "expanded". Setting the item back to null will not remove the previously set pseudo-class. This should probably be changed to either:
A. remove any pseudoclass when the item is set to null, or
B. set the :collapsed pseudoclass and remove the :expanded pseudoclass when the item is set to null.
I don't know whether it matters in practice, since an application doesn't directly manage the creation of the cells (other than by providing a cell factory) or setting the item. The pseudo-class state of the cell is a proxy for the item it points to. Ideally, it would only contain the "empty" state if the item is null, but given that such a cell would never be rendered it would be hard to point to something that doesn't work as a result.
See the discussion in https://git.openjdk.java.net/jfx/pull/413 for more information.
- relates to
-
JDK-8089913 CSS pseudo classes missing by default for some controls
-
- Resolved
-