Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272386

Let Node.managed become CSS-styleable

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: openjfx18
    • Component/s: javafx
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Promotes managed property as CSS styleable. This has minimal to no compatibility risk.
    • Interface Kind:
      File or wire format
    • Scope:
      JDK

      Description

      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">&nbsp;</td>
      +            <td>Defines whether this node's layout will be managed by its parent</td>
      +        </tr>
             </tbody>
           </table>
           <h4>Pseudo-classes</h4>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abagarwal Abhinay Agarwal
              Reporter:
              mkarg Markus Karg
              Reviewed By:
              Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: