Summary
Node's managed
property should be CSS styleable
Problem
A Node can be hidden via CSS by setting "visibility: hidden". However, an invisible Node still occupies space in its Parent. The only way to manage its layout is by setting its width and height to zero using "-fx-pref-width" and "-fx-pref-height" respectively.
Solution
Make managed property of Node class CSS styleable via -fx-managed
CSS Property. To implement this managedProperty
in Node.java should become a styleable property.
Specification
Update the Node
properties in cssref.html
:
diff --git a/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html b/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html
index c64dc03cd3..5e33edaed1 100644
--- a/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html
+++ b/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html
@@ -1750,6 +1750,13 @@
<td>See <a href="http://www.w3.org/TR/CSS2/visufx.html#visibility">W3C
visibility property</a></td>
</tr>
+ <tr>
+ <th class="propertyname" scope="row">-fx-managed</th>
+ <td class="value"><a href="#typeboolean" class="typelink"><boolean></a></td>
+ <td class="default">true</td>
+ <td class="range"> </td>
+ <td>Defines whether this node's layout will be managed by its parent</td>
+ </tr>
</tbody>
</table>
<h4>Pseudo-classes</h4>
- csr of
-
JDK-8172095 Let Node.managed become CSS-styleable
- Resolved