As you can see in the implementation of the visible property in the Node class there is no difference between "hidden" and "collapsed".
Normally the size of a "collapsed" node should not be used for layout and min/pref/max size calculation of its parent. Therefore I would introduce a new styleable property called invisibleType with an enum HIDDEN or COLLAPSED. It can use the same CSS attribute (visibility). If visibility is set to "collapsed" the invisibleType property of the node contains COLLAPSED. In this case the node will be handled like a not managed node (managed property == false). In this case some if cases in the Parent class need to be updated:
if (!node.isManaged() || (!node.isVisible() && node.getInvisibleType().equals(COLLAPSED))) {
....
}
Normally the size of a "collapsed" node should not be used for layout and min/pref/max size calculation of its parent. Therefore I would introduce a new styleable property called invisibleType with an enum HIDDEN or COLLAPSED. It can use the same CSS attribute (visibility). If visibility is set to "collapsed" the invisibleType property of the node contains COLLAPSED. In this case the node will be handled like a not managed node (managed property == false). In this case some if cases in the Parent class need to be updated:
if (!node.isManaged() || (!node.isVisible() && node.getInvisibleType().equals(COLLAPSED))) {
....
}