Module MaterialFX

Class MFXStepperToggle

All Implemented Interfaces:
Validated, Styleable, EventTarget, Skinnable

public class MFXStepperToggle extends Control implements Validated
A MFXStepperToggle is a special toggle that has 4 possible states.

In a MFXStepper these states are used as follows:

- NONE (when initialized)

- SELECTED (self explanatory)

- ERROR (when the validator's state is invalid)

- COMPLETED (when the validator's state in valid and the stepper goes to the next toggle)

Every MFXStepperToggle has an icon, and a text which will be displayed in a label above or below the toggle depending on the value of textPositionProperty().

They also specify the content to be shown in the MFXStepper when the toggle is selected, the content can be any Node.

This control specifies three new PseudoClasses: ":selected", ":completed", ":error" to specify a different style in css for each state.

This is a Validated control, meaning that by default the control offers a MFXValidator on which you can add certain conditions/constraints (or even dependencies, other validators) that must be met in order for the state to be COMPLETED and for the MFXStepper to go to the next toggle.
  • Property Details

  • Field Details

    • SELECTED_PSEUDO_CLASS

      protected static final PseudoClass SELECTED_PSEUDO_CLASS
    • COMPLETED_PSEUDO_CLASS

      protected static final PseudoClass COMPLETED_PSEUDO_CLASS
  • Constructor Details

    • MFXStepperToggle

      public MFXStepperToggle()
    • MFXStepperToggle

      public MFXStepperToggle(String text)
    • MFXStepperToggle

      public MFXStepperToggle(String text, Node icon)
    • MFXStepperToggle

      public MFXStepperToggle(String text, Node icon, Node content)
  • Method Details

    • getValidator

      public MFXValidator getValidator()
      Specified by:
      getValidator in interface Validated
      Returns:
      the MFXValidator instance of this control
    • getGraphicBounds

      public Bounds getGraphicBounds()
      This method is necessary to get the bounds of the toggle's circle, which is used in the MFXStepperSkin to resize the progress bar properly.
    • getContent

      public Node getContent()
      Returns:
      the content to be shown in the stepper when selected
    • setContent

      public void setContent(Node content)
      Sets the content to be shown in the stepper when selected.
    • getText

      public String getText()
      Gets the value of the property text.
      Property description:
      Specifies the text to be shown above or below the toggle.
    • textProperty

      public StringProperty textProperty()
      Specifies the text to be shown above or below the toggle.
      See Also:
    • setText

      public void setText(String text)
      Sets the value of the property text.
      Property description:
      Specifies the text to be shown above or below the toggle.
    • getIcon

      public Node getIcon()
      Gets the value of the property icon.
      Property description:
      Specifies the icon shown in the circle of the toggle.
    • iconProperty

      public ObjectProperty<Node> iconProperty()
      Specifies the icon shown in the circle of the toggle.
      See Also:
    • setIcon

      public void setIcon(Node icon)
      Sets the value of the property icon.
      Property description:
      Specifies the icon shown in the circle of the toggle.
    • getState

      public StepperToggleState getState()
      Gets the value of the property state.
      Property description:
      Specifies the state of the toggle.
    • stateProperty

      public ObjectProperty<StepperToggleState> stateProperty()
      Specifies the state of the toggle.
      See Also:
    • setState

      public void setState(StepperToggleState state)
      Sets the value of the property state.
      Property description:
      Specifies the state of the toggle.
    • isShowErrorIcon

      public boolean isShowErrorIcon()
      Gets the value of the property showErrorIcon.
      Property description:
      Specifies if a little error icon should be shown when the state is ERROR in the upper right corner of the toggle (default position defined in the skin).
    • showErrorIconProperty

      public BooleanProperty showErrorIconProperty()
      Specifies if a little error icon should be shown when the state is ERROR in the upper right corner of the toggle (default position defined in the skin).
      See Also:
    • setShowErrorIcon

      public void setShowErrorIcon(boolean showErrorIcon)
      Sets the value of the property showErrorIcon.
      Property description:
      Specifies if a little error icon should be shown when the state is ERROR in the upper right corner of the toggle (default position defined in the skin).
    • getLabelTextGap

      public double getLabelTextGap()
      Gets the value of the property labelTextGap.
      Property description:
      Specifies the gap between the toggle's circle and the label.
    • labelTextGapProperty

      public StyleableDoubleProperty labelTextGapProperty()
      Specifies the gap between the toggle's circle and the label.
      See Also:
    • setLabelTextGap

      public void setLabelTextGap(double labelTextGap)
      Sets the value of the property labelTextGap.
      Property description:
      Specifies the gap between the toggle's circle and the label.
    • getTextPosition

      public TextPosition getTextPosition()
      Gets the value of the property textPosition.
      Property description:
      Specifies the position of the label.
    • textPositionProperty

      public StyleableObjectProperty<TextPosition> textPositionProperty()
      Specifies the position of the label.
      See Also:
    • setTextPosition

      public void setTextPosition(TextPosition textPosition)
      Sets the value of the property textPosition.
      Property description:
      Specifies the position of the label.
    • getSize

      public double getSize()
      Gets the value of the property size.
      Property description:
      Specifies the radius of the toggle's circle.
    • sizeProperty

      public StyleableDoubleProperty sizeProperty()
      Specifies the radius of the toggle's circle.
      See Also:
    • setSize

      public void setSize(double size)
      Sets the value of the property size.
      Property description:
      Specifies the radius of the toggle's circle.
    • getStrokeWidth

      public double getStrokeWidth()
      Gets the value of the property strokeWidth.
      Property description:
      Specifies the stroke width of the toggle's circle.
    • strokeWidthProperty

      public StyleableDoubleProperty strokeWidthProperty()
      Specifies the stroke width of the toggle's circle.
      See Also:
    • setStrokeWidth

      public void setStrokeWidth(double strokeWidth)
      Sets the value of the property strokeWidth.
      Property description:
      Specifies the stroke width of the toggle's circle.
    • getControlCssMetaDataList

      public static List<CssMetaData<? extends Styleable,?>> getControlCssMetaDataList()
    • createDefaultSkin

      protected Skin<?> createDefaultSkin()
      Overrides:
      createDefaultSkin in class Control
    • getControlCssMetaData

      public List<CssMetaData<? extends Styleable,?>> getControlCssMetaData()
      Overrides:
      getControlCssMetaData in class Control
    • getUserAgentStylesheet

      public String getUserAgentStylesheet()
      Overrides:
      getUserAgentStylesheet in class Region