Interface ToggleButtonBuilder<C extends JToggleButton, B extends ToggleButtonBuilder<C,B>>
- Type Parameters:
C- the component typeB- the builder type
- All Superinterfaces:
ButtonBuilder<C,Boolean, B>, ComponentBuilder<C, B>, ComponentValueBuilder<C, Boolean, B>, Supplier<C>
- All Known Subinterfaces:
CheckBoxBuilder, NullableCheckBoxBuilder, RadioButtonBuilder
public interface ToggleButtonBuilder<C extends JToggleButton, B extends ToggleButtonBuilder<C,B>>
extends ButtonBuilder<C,Boolean,B>
Builds a JToggleButton.
-
Field Summary
Fields inherited from interface ComponentValueBuilder
COMPONENT_VALUE -
Method Summary
Modifier and TypeMethodDescriptionstatic <B extends ToggleButtonBuilder<JToggleButton, B>>
ToggleButtonBuilder<JToggleButton, B> builder()link(ObservableState linkedState) Creates a read-only link to the givenObservableState.Creates a bidirectional link to the given state.toggle(ToggleControl toggleControl) Links the value of the given toggle control to the button, the button toggling it, the control providing the caption, icon and enabled state.toggle(Supplier<ToggleControl> toggleControl) Methods inherited from interface ButtonBuilder
action, actionListener, borderPainted, buttonGroup, contentAreaFilled, control, control, disabledIcon, disabledSelectedIcon, focusPainted, horizontalAlignment, horizontalTextPosition, icon, iconTextGap, includeText, margin, mnemonic, multiClickThreshold, pressedIcon, rolloverEnabled, rolloverIcon, rolloverSelectedIcon, selected, selectedIcon, text, verticalAlignment, verticalTextPositionMethods inherited from interface ComponentBuilder
ancestorListener, background, border, build, build, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusable, focusCycleRoot, focusListener, font, font, foreground, get, hierarchyListener, keyEvent, keyListener, label, label, label, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onSetVisible, opaque, popupControl, popupControls, popupControls, popupMenu, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, toolTipText, transferFocusOnEnter, transferFocusOnEnter, transferHandler, visible, visibleMethods inherited from interface ComponentValueBuilder
buildValue, buildValue, changeConsumer, changeListener, consumer, link, link, listener, modified, modifiedIndicator, onBuildValue, valid, valid, validationIndicator, validator, value, warned, weakChangeConsumer, weakChangeListener, weakConsumer, weakListener, when, when, when, when
-
Method Details
-
toggle
Links the value of the given toggle control to the button, the button toggling it, the control providing the caption, icon and enabled state.- Parameters:
toggleControl- the toggle control to base this toggle button on- Returns:
- this builder instance
- Throws:
IllegalArgumentException- in case the value is nullable and the button can not represent null
-
toggle
- Parameters:
toggleControl- the toggle control to base this toggle button on- Returns:
- this builder instance
-
link
-
link
Creates a read-only link to the givenObservableState.- Parameters:
linkedState- a state to link to the component value- Returns:
- this builder instance
-
builder
static <B extends ToggleButtonBuilder<JToggleButton, B>> ToggleButtonBuilder<JToggleButton, B> builder()- Type Parameters:
B- the builder type- Returns:
- a builder for a toggle button
-