java.lang.Object
io.github.sosuisen.jfxbuilder.controls.RadioMenuItemBuilder

public class RadioMenuItemBuilder extends Object
The RadioMenuItemBuilder class constructs instances of the RadioMenuItem class and offers a fluent interface for creating and configuring it.

This class includes a static create method that accepts the same arguments as the original RadioMenuItem constructor and returns an instance of the RadioMenuItemBuilder.

You can use method chaining to call the builder methods for configuring the RadioMenuItem. Finally, invoke the build method to generate an instance of the RadioMenuItem class.

Note that intermediate builder methods are not evaluated until the build method is called, meaning they are evaluated lazily.

Author:
Hidekazu Kubota <hidekazu.kubota@gmail.com>
  • Method Details

    • create

      public static RadioMenuItemBuilder create()
      Returns an instance of the RadioMenuItemBuilder.
      Returns:
      an instance of the RadioMenuItemBuilder.
    • create

      public static RadioMenuItemBuilder create(String text)
      Accepts the constructor arguments of RadioMenuItem(String) and returns an instance of RadioMenuItemBuilder.
      Returns:
      an instance of the RadioMenuItemBuilder.
    • create

      public static RadioMenuItemBuilder create(String text, Node graphic)
      Accepts the constructor arguments of RadioMenuItem(String, Node) and returns an instance of RadioMenuItemBuilder.
      Returns:
      an instance of the RadioMenuItemBuilder.
    • build

      public RadioMenuItem build()
      Builds and returns an instance of the RadioMenuItem class.

      Intermediate builder methods are not evaluated until the build method is called; in other words, they are evaluated lazily.

      Returns:
      new instance of the RadioMenuItem class
    • apply

      Applies a function to the RadioMenuItem instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • accelerator

      public RadioMenuItemBuilder accelerator(KeyCombination value)
      A builder method that invokes the setAccelerator method on the instance being constructed.
      Returns:
      builder instance
    • disable

      public RadioMenuItemBuilder disable(boolean value)
      A builder method that invokes the setDisable method on the instance being constructed.
      Returns:
      builder instance
    • graphic

      public RadioMenuItemBuilder graphic(Node value)
      A builder method that invokes the setGraphic method on the instance being constructed.
      Returns:
      builder instance
    • id

      public RadioMenuItemBuilder id(String value)
      A builder method that invokes the setId method on the instance being constructed.
      Returns:
      builder instance
    • mnemonicParsing

      public RadioMenuItemBuilder mnemonicParsing(boolean value)
      A builder method that invokes the setMnemonicParsing method on the instance being constructed.
      Returns:
      builder instance
    • onAction

      public RadioMenuItemBuilder onAction(EventHandler<ActionEvent> value)
      A builder method that invokes the setOnAction method on the instance being constructed.
      Returns:
      builder instance
    • onMenuValidation

      public RadioMenuItemBuilder onMenuValidation(EventHandler<Event> value)
      A builder method that invokes the setOnMenuValidation method on the instance being constructed.
      Returns:
      builder instance
    • selected

      public RadioMenuItemBuilder selected(boolean value)
      A builder method that invokes the setSelected method on the instance being constructed.
      Returns:
      builder instance
    • style

      public RadioMenuItemBuilder style(String value)
      A builder method that invokes the setStyle method on the instance being constructed.
      Returns:
      builder instance
    • text

      public RadioMenuItemBuilder text(String value)
      A builder method that invokes the setText method on the instance being constructed.
      Returns:
      builder instance
    • toggleGroup

      public RadioMenuItemBuilder toggleGroup(ToggleGroup value)
      A builder method that invokes the setToggleGroup method on the instance being constructed.
      Returns:
      builder instance
    • userData

      public RadioMenuItemBuilder userData(Object value)
      A builder method that invokes the setUserData method on the instance being constructed.
      Returns:
      builder instance
    • visible

      public RadioMenuItemBuilder visible(boolean value)
      A builder method that invokes the setVisible method on the instance being constructed.
      Returns:
      builder instance
    • addStyleClass

      public final RadioMenuItemBuilder addStyleClass(String... elements)
      Calls the addAll method on the ObservableList returned by the RadioMenuItem#getStyleClass() method.
      Returns:
      builder instance
    • addStyleClass

      public final RadioMenuItemBuilder addStyleClass(Collection<? extends String> col)
      Calls the addAll method on the ObservableList returned by the RadioMenuItem#getStyleClass() method.
      Returns:
      builder instance
    • acceleratorPropertyApply

      public RadioMenuItemBuilder acceleratorPropertyApply(Consumer<ObjectProperty<KeyCombination>> op)
      Applies a function to the acceleratorProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.acceleratorProperty().bind(anotherProperty))
      
      // Use shorthand form
      .acceleratorPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • disablePropertyApply

      public RadioMenuItemBuilder disablePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the disableProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.disableProperty().bind(anotherProperty))
      
      // Use shorthand form
      .disablePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • graphicPropertyApply

      public RadioMenuItemBuilder graphicPropertyApply(Consumer<ObjectProperty<Node>> op)
      Applies a function to the graphicProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.graphicProperty().bind(anotherProperty))
      
      // Use shorthand form
      .graphicPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • idPropertyApply

      public RadioMenuItemBuilder idPropertyApply(Consumer<StringProperty> op)
      Applies a function to the idProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.idProperty().bind(anotherProperty))
      
      // Use shorthand form
      .idPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • mnemonicParsingPropertyApply

      public RadioMenuItemBuilder mnemonicParsingPropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the mnemonicParsingProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.mnemonicParsingProperty().bind(anotherProperty))
      
      // Use shorthand form
      .mnemonicParsingPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onActionPropertyApply

      Applies a function to the onActionProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onActionProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onActionPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • onMenuValidationPropertyApply

      public RadioMenuItemBuilder onMenuValidationPropertyApply(Consumer<ObjectProperty<EventHandler<Event>>> op)
      Applies a function to the onMenuValidationProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.onMenuValidationProperty().bind(anotherProperty))
      
      // Use shorthand form
      .onMenuValidationPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • parentMenuPropertyApply

      public RadioMenuItemBuilder parentMenuPropertyApply(Consumer<ReadOnlyObjectProperty<Menu>> op)
      Applies a function to the parentMenuProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.parentMenuProperty().bind(anotherProperty))
      
      // Use shorthand form
      .parentMenuPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • parentPopupPropertyApply

      public RadioMenuItemBuilder parentPopupPropertyApply(Consumer<ReadOnlyObjectProperty<ContextMenu>> op)
      Applies a function to the parentPopupProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.parentPopupProperty().bind(anotherProperty))
      
      // Use shorthand form
      .parentPopupPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • selectedPropertyApply

      public RadioMenuItemBuilder selectedPropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the selectedProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.selectedProperty().bind(anotherProperty))
      
      // Use shorthand form
      .selectedPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • stylePropertyApply

      public RadioMenuItemBuilder stylePropertyApply(Consumer<StringProperty> op)
      Applies a function to the styleProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.styleProperty().bind(anotherProperty))
      
      // Use shorthand form
      .stylePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • textPropertyApply

      public RadioMenuItemBuilder textPropertyApply(Consumer<StringProperty> op)
      Applies a function to the textProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.textProperty().bind(anotherProperty))
      
      // Use shorthand form
      .textPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • toggleGroupPropertyApply

      public RadioMenuItemBuilder toggleGroupPropertyApply(Consumer<ObjectProperty<ToggleGroup>> op)
      Applies a function to the toggleGroupProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.toggleGroupProperty().bind(anotherProperty))
      
      // Use shorthand form
      .toggleGroupPropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance
    • visiblePropertyApply

      public RadioMenuItemBuilder visiblePropertyApply(Consumer<BooleanProperty> op)
      Applies a function to the visibleProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      // Use apply
      .apply(obj -> obj.visibleProperty().bind(anotherProperty))
      
      // Use shorthand form
      .visiblePropertyApply(prop -> prop.bind(anotherProperty))
      
      Returns:
      builder instance