Package com.dua3.utility.fx.controls
Klasse ButtonBuilder<B extends ButtonBase>
java.lang.Object
com.dua3.utility.fx.controls.abstract_builders.NodeBuilder<B,ButtonBuilder<B>>
com.dua3.utility.fx.controls.abstract_builders.ControlBuilder<B,ButtonBuilder<B>>
com.dua3.utility.fx.controls.abstract_builders.LabeledBuilder<B,ButtonBuilder<B>>
com.dua3.utility.fx.controls.abstract_builders.ButtonBaseBuilder<B,ButtonBuilder<B>>
com.dua3.utility.fx.controls.ButtonBuilder<B>
- Typparameter:
B- the type of Button subclass to build
The ButtonBuilder class is a utility class used to build Button instances in a fluent way.
It provides methods to set properties such as text, graphic, tooltip, action, and disabled state
of the button. The built button can be obtained by calling the build() method.
Usage example:
ButtonBuilder<Button> builder = new ButtonBuilder<>(Button::new);
Button button = builder
.text("Click me")
.graphic(new ImageView("icon.png"))
.tooltip("Tooltip text")
.action(event -> System.out.println("Button clicked"))
.bindDisabled(disabledProperty)
.build();
In the example above, a new ButtonBuilder instance is created and bound to the Button class.
The text, graphic, tooltip, action, and disabled state of the button are set using the builder
methods. Finally, the build() method is called to create the button instance with the specified properties.-
Methodenübersicht
Von Klasse geerbte Methoden com.dua3.utility.fx.controls.abstract_builders.ButtonBaseBuilder
action, action, bindAction, bindAction, buildVon Klasse geerbte Methoden com.dua3.utility.fx.controls.abstract_builders.LabeledBuilder
bindFont, bindFxFont, bindText, font, font, graphic, graphic, textVon Klasse geerbte Methoden com.dua3.utility.fx.controls.abstract_builders.ControlBuilder
bindTooltip, tooltipVon Klasse geerbte Methoden com.dua3.utility.fx.controls.abstract_builders.NodeBuilder
apply, apply, bindDisabled, bindEnabled, disabled, prefHeight, prefSize, prefWidth, self