Package javafx.scene

Class StyleTrigger

java.lang.Object
javafx.scene.StyleTrigger

public class StyleTrigger
extends Object
Style triggers dynamically add or remove style classes from a Node depending on a user-specified condition.

If the condition is true, the specified style classes are added to the Node.getStyleClass() list; if it is false, the style classes are removed.

Once a style trigger is added to Node.getStyleTriggers(), it is attached to the node and can not be re-used for another node unless it is removed from the original node.

  • Property Details

  • Constructor Details

    • StyleTrigger

      public StyleTrigger()
    • StyleTrigger

      public StyleTrigger​(String... styleClass)
  • Method Details

    • getStyleClass

      public ObservableList<String> getStyleClass()
      Gets the list of style classes that will be dynamically added to the Node's style class list.
      Returns:
      an ObservableList of style classes
    • conditionProperty

      public BooleanProperty conditionProperty()
      The condition that determines whether the style classes contained in getStyleClass() are added to the Node's style class list.
      See Also:
      isCondition(), setCondition(boolean)
    • isCondition

      public boolean isCondition()
      Gets the value of the property condition.
      Property description:
      The condition that determines whether the style classes contained in getStyleClass() are added to the Node's style class list.
    • setCondition

      public void setCondition​(boolean value)
      Sets the value of the property condition.
      Property description:
      The condition that determines whether the style classes contained in getStyleClass() are added to the Node's style class list.