Text
Node has the same StyleClass as the parent Button
, but the StyleClass of the Pane
is not applied to the Button
.A661_EDIT_BOX_NUMERIC
widget legend to be different from the color of the numeric value, but if you simply define the-fx-text-fill property in the CSS like that:A661_EDIT_BOX_NUMERIC_Style1 { -fx-text-fill: yellow; -fx-background-color: null; }Both the legend and the numeric value (which are implemented by different
Text
children Nodes) will share the same color:<ui name="RafaleFX" type="jfx" > <property name="url" value="rafale.css" /> <property name="componentsStructure" value="componentsStructure.xml" /> <property name="componentsStyles" value="componentsStyles.xml" /> </ui>
A661_EDIT_BOX_NUMERIC
widget, we have the following structure:<widget arincID="A661_EDIT_BOX_NUMERIC"> <styleID styleID="default" selector="EditBoxNumericRenderer" path="kids.server.model.stdrenderer.EditBoxNumericRenderer"> <component selector="HBox" id="HBox" path="javafx.scene.layout.HBox" multiplicity="one" apply="copy"> <component selector="label" id="label" path="javafx.scene.control.Label" multiplicity="one" apply="copy"> <component selector="text" id="text" path="com.sun.javafx.scene.control.skin.LabeledText" multiplicity="one" apply="copy"/> </component> <component selector="DecoratedLabel" id="DecoratedLabel" path="arinc661.server.jfx.model.components.DecoratedLabel" multiplicity="one" apply="copy"> <component selector="Pane" id="Pane" path="javafx.scene.layout.Pane" multiplicity="one" apply="copy"/> <component selector="text" id="text" path="com.sun.javafx.scene.control.skin.LabeledText" multiplicity="one" apply="copy"/> </component> </component> </styleID> </widget>Here we can see that the
A661_EDIT_BOX_NUMERIC
widget has two hgh-level sub-components:<widget arincID="A661_EDIT_BOX_NUMERIC"> <styleID styleID="default" selector="EditBoxNumericRenderer" path="kids.server.model.stdrenderer.EditBoxNumericRenderer"> <component selector="HBox" id="HBox" path="javafx.scene.layout.HBox" multiplicity="one" apply="copy"> <component selector="label" id="label" path="javafx.scene.control.Label" multiplicity="one" apply="set"> <component selector="text" id="text" path="com.sun.javafx.scene.control.skin.LabeledText" multiplicity="one" apply="copy"/> </component> <component selector="DecoratedLabel" id="DecoratedLabel" path="arinc661.server.jfx.model.components.DecoratedLabel" multiplicity="one" apply="copy"> <component selector="Pane" id="Pane" path="javafx.scene.layout.Pane" multiplicity="one" apply="copy"/> <component selector="text" id="text" path="com.sun.javafx.scene.control.skin.LabeledText" multiplicity="one" apply="copy"/> </component> </component> </styleID> </widget>
styleSet="1"
, styleSet="*"
(specifies all StyleSets), styleSet="*-20"
(specifies all StyleSets whose value are lower or equal than 20), styleSet="21-*"
(specifies all StyleSets whose value are greater or equal than 21), styleSet="10-15"
(specifies StyleSets between 10 and 15)A661_EDIT_BOX_NUMERIC
widget case, we specify here that we want the StyleClass of the legend (corresponding to the "label" component) to be set to "legendRed" for the StyleSet with the value 1:<jfxComponentsStyles> <widget arincID="A661_EDIT_BOX_NUMERIC"> <styleSet styleSet="1"> <component id="label" styleClass="legendRed" /> </styleSet> </widget> </jfxComponentsStyles>The "legendRed" StyleClass can then be specified as any other StyleClass in the CSS file:
.legendRed { -fx-text-fill: red; }The result is:
styleSet="1"
, styleSet="*"
(specifies all StyleSets), styleSet="*-20"
(specifies all StyleSets whose value are lower or equal than 20), styleSet="21-*"
(specifies all StyleSets whose value are greater or equal than 21), styleSet="10-15"
(specifies StyleSets between 10 and 15)Copyright 2016-2017 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v2 licence