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 MenuBarSkinBuilder
addChildren
(Collection<? extends Node> col) Calls theaddAll
method on the ObservableList returned by theMenuBarSkin#getChildren()
method.final MenuBarSkinBuilder
addChildren
(Node... elements) Calls theaddAll
method 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 theMenuBarSkin
class.containerAlignment
(Pos value) A builder method that invokes thesetContainerAlignment
method on the instance being constructed.Applies a function to thecontainerAlignmentProperty
of the instance being constructed.static MenuBarSkinBuilder
Accepts the constructor arguments ofMenuBarSkin(MenuBar)
and returns an instance ofMenuBarSkinBuilder
.spacing
(double value) A builder method that invokes thesetSpacing
method on the instance being constructed.Applies a function to thespacingProperty
of 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 theMenuBarSkin
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
MenuBarSkin
class
-
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 thesetContainerAlignment
method on the instance being constructed.- Returns:
- builder instance
-
spacing
A builder method that invokes thesetSpacing
method on the instance being constructed.- Returns:
- builder instance
-
addChildren
Calls theaddAll
method on the ObservableList returned by theMenuBarSkin#getChildren()
method.- Returns:
- builder instance
-
addChildren
Calls theaddAll
method on the ObservableList returned by theMenuBarSkin#getChildren()
method.- Returns:
- builder instance
-
containerAlignmentPropertyApply
Applies a function to thecontainerAlignmentProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-
spacingPropertyApply
Applies a function to thespacingProperty
of the instance being constructed. This serves as a shorthand form of theapply
method.Example:
- Returns:
- builder instance
-