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

public class TabBuilder extends Object
The TabBuilder class constructs instances of the Tab 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 Tab constructor and returns an instance of the TabBuilder.

You can use method chaining to call the builder methods for configuring the Tab. Finally, invoke the build method to generate an instance of the Tab 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 TabBuilder create()
      Returns an instance of the TabBuilder.
      Returns:
      an instance of the TabBuilder.
    • create

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

      public static TabBuilder create(String text, Node content)
      Accepts the constructor arguments of Tab(String, Node) and returns an instance of TabBuilder.
      Returns:
      an instance of the TabBuilder.
    • build

      public Tab build()
      Builds and returns an instance of the Tab 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 Tab class
    • apply

      public TabBuilder apply(Consumer<Tab> func)
      Applies a function to the Tab instance being constructed. Most operations on the instance can be performed using this method.
      Returns:
      builder instance
    • closable

      public TabBuilder closable(boolean value)
      A builder method that invokes the setClosable method on the instance being constructed.
      Returns:
      builder instance
    • content

      public TabBuilder content(Node value)
      A builder method that invokes the setContent method on the instance being constructed.
      Returns:
      builder instance
    • contextMenu

      public TabBuilder contextMenu(ContextMenu value)
      A builder method that invokes the setContextMenu method on the instance being constructed.
      Returns:
      builder instance
    • disable

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

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

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

      public TabBuilder onCloseRequest(EventHandler<Event> value)
      A builder method that invokes the setOnCloseRequest method on the instance being constructed.
      Returns:
      builder instance
    • onClosed

      public TabBuilder onClosed(EventHandler<Event> value)
      A builder method that invokes the setOnClosed method on the instance being constructed.
      Returns:
      builder instance
    • onSelectionChanged

      public TabBuilder onSelectionChanged(EventHandler<Event> value)
      A builder method that invokes the setOnSelectionChanged method on the instance being constructed.
      Returns:
      builder instance
    • style

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

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

      public TabBuilder tooltip(Tooltip value)
      A builder method that invokes the setTooltip method on the instance being constructed.
      Returns:
      builder instance
    • userData

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

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

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

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

      Example:

      Returns:
      builder instance
    • contentPropertyApply

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

      Example:

      Returns:
      builder instance
    • contextMenuPropertyApply

      public TabBuilder contextMenuPropertyApply(Consumer<ObjectProperty<ContextMenu>> op)
      Applies a function to the contextMenuProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • disablePropertyApply

      public TabBuilder 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:

      Returns:
      builder instance
    • disabledPropertyApply

      public TabBuilder disabledPropertyApply(Consumer<ReadOnlyBooleanProperty> op)
      Applies a function to the disabledProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • graphicPropertyApply

      public TabBuilder 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:

      Returns:
      builder instance
    • idPropertyApply

      public TabBuilder 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:

      Returns:
      builder instance
    • onCloseRequestPropertyApply

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

      Example:

      Returns:
      builder instance
    • onClosedPropertyApply

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

      Example:

      Returns:
      builder instance
    • onSelectionChangedPropertyApply

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

      Example:

      Returns:
      builder instance
    • selectedPropertyApply

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

      Example:

      Returns:
      builder instance
    • stylePropertyApply

      public TabBuilder 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:

      Returns:
      builder instance
    • tabPanePropertyApply

      public TabBuilder tabPanePropertyApply(Consumer<ReadOnlyObjectProperty<TabPane>> op)
      Applies a function to the tabPaneProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance
    • textPropertyApply

      public TabBuilder 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:

      Returns:
      builder instance
    • tooltipPropertyApply

      public TabBuilder tooltipPropertyApply(Consumer<ObjectProperty<Tooltip>> op)
      Applies a function to the tooltipProperty of the instance being constructed. This serves as a shorthand form of the apply method.

      Example:

      Returns:
      builder instance