Class MenuBarSkinBuilder
java.lang.Object
io.github.sosuisen.jfxbuilder.controls.MenuBarSkinBuilder
The
MenuBarSkinBuilder class constructs instances of the MenuBarSkin 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 MenuBarSkin constructor
and returns an instance of the MenuBarSkinBuilder.
You can use method chaining to call the builder methods for configuring the MenuBarSkin.
Finally, invoke the build method to generate an instance of the MenuBarSkin 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 MenuBarSkinBuilderaddChildren(Collection<? extends Node> col) Calls theaddAllmethod on the ObservableList returned by theMenuBarSkin#getChildren()method.final MenuBarSkinBuilderaddChildren(Node... elements) Calls theaddAllmethod on the ObservableList returned by theMenuBarSkin#getChildren()method.apply(Consumer<MenuBarSkin> func) Applies a function to the MenuBarSkin instance being constructed.build()Builds and returns an instance of theMenuBarSkinclass.containerAlignment(Pos value) A builder method that invokes thesetContainerAlignmentmethod on the instance being constructed.Applies a function to thecontainerAlignmentPropertyof the instance being constructed.static MenuBarSkinBuilderAccepts the constructor arguments ofMenuBarSkin(MenuBar)and returns an instance ofMenuBarSkinBuilder.spacing(double value) A builder method that invokes thesetSpacingmethod on the instance being constructed.Applies a function to thespacingPropertyof the instance being constructed.
-
Method Details
-
create
Accepts the constructor arguments ofMenuBarSkin(MenuBar)and returns an instance ofMenuBarSkinBuilder.- Returns:
- an instance of the
MenuBarSkinBuilder.
-
build
Builds and returns an instance of theMenuBarSkinclass.Intermediate builder methods are not evaluated until the
buildmethod is called; in other words, they are evaluated lazily.- Returns:
- new instance of the
MenuBarSkinclass
-
apply
Applies a function to the MenuBarSkin instance being constructed. Most operations on the instance can be performed using this method.- Returns:
- builder instance
-
containerAlignment
A builder method that invokes thesetContainerAlignmentmethod on the instance being constructed.- Returns:
- builder instance
-
spacing
A builder method that invokes thesetSpacingmethod on the instance being constructed.- Returns:
- builder instance
-
addChildren
Calls theaddAllmethod on the ObservableList returned by theMenuBarSkin#getChildren()method.- Returns:
- builder instance
-
addChildren
Calls theaddAllmethod on the ObservableList returned by theMenuBarSkin#getChildren()method.- Returns:
- builder instance
-
containerAlignmentPropertyApply
Applies a function to thecontainerAlignmentPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.containerAlignmentProperty().bind(anotherProperty)) // Use shorthand form .containerAlignmentPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-
spacingPropertyApply
Applies a function to thespacingPropertyof the instance being constructed. This serves as a shorthand form of theapplymethod.Example:
// Use apply .apply(obj -> obj.spacingProperty().bind(anotherProperty)) // Use shorthand form .spacingPropertyApply(prop -> prop.bind(anotherProperty))- Returns:
- builder instance
-