Class TabBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.TabBuilder
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 Summary
Modifier and TypeMethodDescriptionfinal TabBuilderaddStyleClass(String... elements) Calls theaddAllmethod on the ObservableList returned by theTab#getStyleClass()method.final TabBuilderaddStyleClass(Collection<? extends String> col) Calls theaddAllmethod on the ObservableList returned by theTab#getStyleClass()method.Applies a function to the Tab instance being constructed.build()Builds and returns an instance of theTabclass.closable(boolean value) A builder method that invokes thesetClosablemethod on the instance being constructed.Applies a function to theclosablePropertyof the instance being constructed.A builder method that invokes thesetContentmethod on the instance being constructed.Applies a function to thecontentPropertyof the instance being constructed.contextMenu(ContextMenu value) A builder method that invokes thesetContextMenumethod on the instance being constructed.Applies a function to thecontextMenuPropertyof the instance being constructed.static TabBuildercreate()Returns an instance of theTabBuilder.static TabBuilderAccepts the constructor arguments ofTab(String)and returns an instance ofTabBuilder.static TabBuilderAccepts the constructor arguments ofTab(String, Node)and returns an instance ofTabBuilder.disable(boolean value) A builder method that invokes thesetDisablemethod on the instance being constructed.Applies a function to thedisabledPropertyof the instance being constructed.Applies a function to thedisablePropertyof the instance being constructed.A builder method that invokes thesetGraphicmethod on the instance being constructed.Applies a function to thegraphicPropertyof the instance being constructed.A builder method that invokes thesetIdmethod on the instance being constructed.Applies a function to theidPropertyof the instance being constructed.onClosed(EventHandler<Event> value) A builder method that invokes thesetOnClosedmethod on the instance being constructed.Applies a function to theonClosedPropertyof the instance being constructed.onCloseRequest(EventHandler<Event> value) A builder method that invokes thesetOnCloseRequestmethod on the instance being constructed.Applies a function to theonCloseRequestPropertyof the instance being constructed.onSelectionChanged(EventHandler<Event> value) A builder method that invokes thesetOnSelectionChangedmethod on the instance being constructed.Applies a function to theonSelectionChangedPropertyof the instance being constructed.Applies a function to theselectedPropertyof the instance being constructed.A builder method that invokes thesetStylemethod on the instance being constructed.Applies a function to thestylePropertyof the instance being constructed.Applies a function to thetabPanePropertyof the instance being constructed.A builder method that invokes thesetTextmethod on the instance being constructed.Applies a function to thetextPropertyof the instance being constructed.A builder method that invokes thesetTooltipmethod on the instance being constructed.Applies a function to thetooltipPropertyof the instance being constructed.A builder method that invokes thesetUserDatamethod on the instance being constructed.
-
Method Details
-
create
Returns an instance of theTabBuilder.- Returns:
- an instance of the
TabBuilder.
-
create
Accepts the constructor arguments ofTab(String)and returns an instance ofTabBuilder.- Returns:
- an instance of the
TabBuilder.
-
create
Accepts the constructor arguments ofTab(String, Node)and returns an instance ofTabBuilder.- Returns:
- an instance of the
TabBuilder.
-
build
-
apply
Applies a function to the Tab instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
closable
A builder method that invokes thesetClosablemethod on the instance being constructed.- Returns:
- builder instance
-
content
A builder method that invokes thesetContentmethod on the instance being constructed.- Returns:
- builder instance
-
contextMenu
A builder method that invokes thesetContextMenumethod on the instance being constructed.- Returns:
- builder instance
-
disable
A builder method that invokes thesetDisablemethod on the instance being constructed.- Returns:
- builder instance
-
graphic
A builder method that invokes thesetGraphicmethod on the instance being constructed.- Returns:
- builder instance
-
id
A builder method that invokes thesetIdmethod on the instance being constructed.- Returns:
- builder instance
-
onCloseRequest
A builder method that invokes thesetOnCloseRequestmethod on the instance being constructed.- Returns:
- builder instance
-
onClosed
A builder method that invokes thesetOnClosedmethod on the instance being constructed.- Returns:
- builder instance
-
onSelectionChanged
A builder method that invokes thesetOnSelectionChangedmethod on the instance being constructed.- Returns:
- builder instance
-
style
A builder method that invokes thesetStylemethod on the instance being constructed.- Returns:
- builder instance
-
text
A builder method that invokes thesetTextmethod on the instance being constructed.- Returns:
- builder instance
-
tooltip
A builder method that invokes thesetTooltipmethod on the instance being constructed.- Returns:
- builder instance
-
userData
A builder method that invokes thesetUserDatamethod on the instance being constructed.- Returns:
- builder instance
-
addStyleClass
Calls theaddAllmethod on the ObservableList returned by theTab#getStyleClass()method.- Returns:
- builder instance
-
addStyleClass
Calls theaddAllmethod on the ObservableList returned by theTab#getStyleClass()method.- Returns:
- builder instance
-
closablePropertyApply
Applies a function to theclosablePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.closableProperty().bind(anotherProperty)) // Use shorthand form .closablePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
contentPropertyApply
Applies a function to thecontentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.contentProperty().bind(anotherProperty)) // Use shorthand form .contentPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
contextMenuPropertyApply
Applies a function to thecontextMenuPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.contextMenuProperty().bind(anotherProperty)) // Use shorthand form .contextMenuPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
disablePropertyApply
Applies a function to thedisablePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.disableProperty().bind(anotherProperty)) // Use shorthand form .disablePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
disabledPropertyApply
Applies a function to thedisabledPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.disabledProperty().bind(anotherProperty)) // Use shorthand form .disabledPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
graphicPropertyApply
Applies a function to thegraphicPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.graphicProperty().bind(anotherProperty)) // Use shorthand form .graphicPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
idPropertyApply
Applies a function to theidPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.idProperty().bind(anotherProperty)) // Use shorthand form .idPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onCloseRequestPropertyApply
Applies a function to theonCloseRequestPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onCloseRequestProperty().bind(anotherProperty)) // Use shorthand form .onCloseRequestPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onClosedPropertyApply
Applies a function to theonClosedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onClosedProperty().bind(anotherProperty)) // Use shorthand form .onClosedPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
onSelectionChangedPropertyApply
Applies a function to theonSelectionChangedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.onSelectionChangedProperty().bind(anotherProperty)) // Use shorthand form .onSelectionChangedPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
selectedPropertyApply
Applies a function to theselectedPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.selectedProperty().bind(anotherProperty)) // Use shorthand form .selectedPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
stylePropertyApply
Applies a function to thestylePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.styleProperty().bind(anotherProperty)) // Use shorthand form .stylePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
tabPanePropertyApply
Applies a function to thetabPanePropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.tabPaneProperty().bind(anotherProperty)) // Use shorthand form .tabPanePropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
textPropertyApply
Applies a function to thetextPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.textProperty().bind(anotherProperty)) // Use shorthand form .textPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
tooltipPropertyApply
Applies a function to thetooltipPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.tooltipProperty().bind(anotherProperty)) // Use shorthand form .tooltipPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-