Class UIForAnyButton<I,B extends AbstractButton>
- Type Parameters:
I
- The type parameter for the instance type of this concrete class itself.B
- The type parameter for the component wrapped by an instance of this class.
- Direct Known Subclasses:
UIForAnyMenuItem
,UIForAnyToggleButton
,UIForButton
,UIForCheckBox
,UIForSplitButton
UIForAnySwing
builder type,
and provides additional features associated with the more specialized
AbstractButton
" Swing component type.
One of such features is the onClick(Action)
method allowing for a more readable way of adding
ActionListener
instances to button types...
Please take a look at the living swing-tree documentation
where you can browse a large collection of examples demonstrating how to use the API of this class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
protected final void
_onClick
(B button, Consumer<ActionEvent> action) protected final void
_onModelChange
(B button, Consumer<ChangeEvent> action) isBorderPaintedIf
(boolean borderPainted) Sets theAbstractButton.setBorderPainted(boolean)
flag of the wrapped button type.isBorderPaintedIf
(sprouts.Val<Boolean> val) Binds the providedVal
property to theAbstractButton.setBorderPainted(boolean)
method., which means that whenever the value of the property changes, the border of the button will be painted or not.final I
isPressedIf
(sprouts.Var<Boolean> var) Use this to dynamically bind to aVar
instance which will be used to dynamically model the pressed state of the wrappedAbstractButton
type.final I
isSelectedIf
(boolean isSelected) Use this to set the selection state of the wrapped button type.final I
isSelectedIf
(sprouts.Val<Boolean> selected) Use this to bind to aVar
instance which will be used to dynamically model the selection state of the wrappedAbstractButton
type.final I
isSelectedIf
(sprouts.Var<Boolean> selected) Use this to bind to aVar
instance which will be used to dynamically model the selection state of the wrappedAbstractButton
type.final <T> I
isSelectedIf
(T state, sprouts.Val<T> selection) Use this to dynamically bind the selection flag of the button to aVal
property which will determine the selection state of the button based on the equality of the property value and the provided reference value.final I
isSelectedIfNot
(sprouts.Val<Boolean> selected) Use this to bind to aVar
instance which will be used to dynamically model the inverse selection state of the wrappedAbstractButton
type.final I
isSelectedIfNot
(sprouts.Var<Boolean> selected) Use this to dynamically bind to aVar
instance which will be used to dynamically model the inverse selection state of the wrappedAbstractButton
type.final <T> I
isSelectedIfNot
(T state, sprouts.Val<T> selection) This is the inverse ofisSelectedIf(Object, Val)
.final I
Effectively removes the native style of this button.final I
onChange
(sprouts.Action<ComponentDelegate<B, ItemEvent>> action) This method adds the providedItemListener
instance to the wrapped button component.onClick
(sprouts.Action<ComponentDelegate<B, ActionEvent>> action) This method enables a more readable way of addingActionListener
instances to button types.final I
withButtonGroup
(ButtonGroup group) Use this to attach this button type to a button group.final I
Use this to set the font of the wrapped button type.final I
Use this to dynamically set the font of the wrapped button type through the provided view model property.withFontSize
(int size) Use this to set the size of the font of the wrapped button type.withFontSize
(sprouts.Val<Integer> size) Use this to dynamically set the size of the font of the wrapped button type through the provided view model property.final I
withHorizontalAlignment
(sprouts.Val<UI.HorizontalAlignment> horizontalAlign) A convenience method to avoid peeking into this builder like so:final I
withHorizontalAlignment
(UI.HorizontalAlignment horizontalAlign) A convenience method to avoid peeking into this builder like so:final I
withHorizontalTextAlignment
(sprouts.Val<UI.HorizontalAlignment> horizontalAlign) A convenience method to avoid peeking into this builder like so:final I
withHorizontalTextAlignment
(UI.HorizontalAlignment horizontalAlign) A convenience method to avoid peeking into this builder like so:Takes the providedIcon
and scales it to the provided width and height before displaying it on the wrapped button type.withIcon
(int width, int height, IconDeclaration icon) Takes the providedIconDeclaration
and scales it to the provided width and height before displaying it on the wrapped button type.withIcon
(int width, int height, IconDeclaration icon, UI.FitComponent fitComponent) Takes the providedIconDeclaration
and scales the corresponding icon it to the provided width and height before displaying it on the wrapped button type.Use this to set the icon for the wrapped button type.withIcon
(ImageIcon icon, UI.FitComponent fitComponent) Sets theIcon
property of the wrapped button type and scales it according to the providedUI.FitComponent
policy.withIcon
(sprouts.Val<IconDeclaration> icon) Use this to dynamically set the icon property for the wrapped button type.withIcon
(IconDeclaration icon) Use this to specify the icon for the wrapped button type.withIcon
(IconDeclaration icon, UI.FitComponent fitComponent) final I
withMargin
(int top, int left, int bottom, int right) Use this to set the margin of the wrapped button type.final I
withMargin
(Insets insets) Use this to set the margin of the wrapped button type.final I
Defines the single line of text the wrapped button type will display.final I
Binds the providedVal
property to the wrapped button type and sets the text of the button to the value of the property.final I
withVerticalAlignment
(sprouts.Val<UI.VerticalAlignment> verticalAlign) A convenience method to avoid peeking into this builder like so:final I
withVerticalAlignment
(UI.VerticalAlignment verticalAlign) A convenience method to avoid peeking into this builder like so:final I
withVerticalTextAlignment
(sprouts.Val<UI.VerticalAlignment> verticalAlign) A convenience method to avoid peeking into this builder like so:final I
withVerticalTextAlignment
(UI.VerticalAlignment verticalAlign) A convenience method to avoid peeking into this builder like so:Methods inherited from class swingtree.UIForAnySwing
_addComponentTo, _addViewableProps, _addViewableProps, _isUndefinedColor, _isUndefinedFont, _setBackground, _setEnabled, _setMinHeight, _setMinWidth, _setPrefWidth, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAll, doUpdates, group, group, id, id, isEnabledIf, isEnabledIf, isEnabledIf, isEnabledIfNot, isEnabledIfNot, isEnabledIfNot, isFocusableIf, isFocusableIf, isFocusableIf, isFocusableIfNot, isFocusableIfNot, isFocusableIfNot, isValidIf, isVisibleIf, isVisibleIf, isVisibleIf, isVisibleIfNot, isVisibleIfNot, isVisibleIfNot, makeFocused, makeNonOpaque, makeOpaque, on, on, onCharTyped, onFocusGain, onFocusLoss, onHidden, onKeyPress, onKeyRelease, onKeyTyped, onMouseClick, onMouseDrag, onMouseEnter, onMouseEnter, onMouseEnterGreedy, onMouseExit, onMouseExit, onMouseExitGreedy, onMouseMove, onMousePress, onMouseRelease, onMouseWheelDown, onMouseWheelMove, onMouseWheelUp, onMoved, onPressed, onRelease, onResize, onShown, onTyped, onTyped, onView, withBackground, withBackground, withBackgroundColor, withBackgroundIf, withBackgroundIf, withBackgroundIf, withBackgroundIf, withBorder, withBorder, withBorderTitled, withBorderTitled, withBoxLayout, withCompoundBorder, withCompoundBorderTitled, withCursor, withCursor, withCursorIf, withCursorIf, withDragAway, withDropSite, withEmptyBorder, withEmptyBorder, withEmptyBorder, withEmptyBorder, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withFlowLayout, withFlowLayout, withFlowLayout, withForeground, withForeground, withForegroundColor, withForegroundIf, withForegroundIf, withForegroundIf, withForegroundIf, withGridBagLayout, withGridLayout, withGridLayout, withGridLayout, withHeight, withHeight, withHeightExactly, withHeightExactly, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLineBorder, withLineBorder, withLineBorder, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withMatteBorder, withMatteBorder, withMatteBorder, withMatteBorderTitled, withMatteBorderTitled, withMatteBorderTitled, withMaxHeight, withMaxHeight, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxWidth, withMaxWidth, withMinHeight, withMinHeight, withMinSize, withMinSize, withMinSize, withMinSize, withMinSize, withMinWidth, withMinWidth, withPrefHeight, withPrefHeight, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefWidth, withPrefWidth, withProperty, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withSize, withSize, withSize, withSize, withSizeExactly, withSizeExactly, withSizeExactly, withSizeExactly, withStyle, withTooltip, withTooltip, withTransitionalStyle, withTransitoryStyle, withWidth, withWidth, withWidthExactly, withWidthExactly
Methods inherited from class swingtree.UIForAnything
_addBuildersTo, _addBuilderTo, _addComponentsTo, _disposeState, _newBuilderWithState, _onShow, _onShow, _runInApp, _runInApp, _runInUI, _state, _this, _with, _withOnShow, _withOnShow, add, add, add, add, apply, applyIf, applyIfPresent, component, equals, get, getComponent, getType, hashCode, peek, toString
-
Constructor Details
-
UIForAnyButton
public UIForAnyButton()
-
-
Method Details
-
withText
Defines the single line of text the wrapped button type will display. If the value of text is null or empty string, nothing is displayed.- Parameters:
text
- The new text to be set for the wrapped button type.- Returns:
- This very builder to allow for method chaining.
-
withText
Binds the providedVal
property to the wrapped button type and sets the text of the button to the value of the property. Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to manually send the property value to this view component.- Parameters:
text
- The view model property which should be bound to this UI.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- iftext
isnull
.
-
withIcon
Use this to set the icon for the wrapped button type. This is in essence a convenience method to avoid peeking into this builder like so:UI.button("Something") .peek( button -> button.setIcon(...) );
- Parameters:
icon
- TheIcon
which should be displayed on the button.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ificon
isnull
.
-
withIcon
Takes the providedIcon
and scales it to the provided width and height before displaying it on the wrapped button type.- Parameters:
width
- The width of the icon.height
- The height of the icon.icon
- TheIcon
which should be scaled and displayed on the button.- Returns:
- This very builder to allow for method chaining.
-
withIcon
Takes the providedIconDeclaration
and scales it to the provided width and height before displaying it on the wrapped button type.- Parameters:
width
- The width of the icon.height
- The height of the icon.icon
- TheIconDeclaration
which should be scaled and displayed on the button.- Returns:
- This very builder to allow for method chaining.
-
withIcon
Takes the providedIconDeclaration
and scales the corresponding icon it to the provided width and height before displaying it on the wrapped button type.- Parameters:
width
- The width of the icon.height
- The height of the icon.icon
- TheIcon
which should be scaled and displayed on the button.fitComponent
- TheUI.FitComponent
which determines how the icon should be scaled relative to the button.- Returns:
- This very builder to allow for method chaining.
-
withIcon
Sets theIcon
property of the wrapped button type and scales it according to the providedUI.FitComponent
policy. This icon is also used as the "pressed" and "disabled" icon if there is no explicitly set pressed icon.- Parameters:
icon
- TheSvgIcon
which should be displayed on the button.fitComponent
- TheUI.FitComponent
which determines how the icon should be scaled.- Returns:
- This very builder to allow for method chaining.
-
withIcon
-
withIcon
Use this to specify the icon for the wrapped button type. The icon is determined based on the providedIconDeclaration
instance which is conceptually merely a resource path to the icon.- Parameters:
icon
- The desired icon to be displayed on top of the button.- Returns:
- This very builder to allow for method chaining.
-
withIcon
Use this to dynamically set the icon property for the wrapped button type. When the icon wrapped by the provided property changes, then so does the icon displayed on this button.But note that you may not use the
Icon
orImageIcon
classes directly, instead you must use implementations of theIconDeclaration
interface, which merely models the resource location of the icon, but does not load the whole icon itself.The reason for this distinction is the fact that traditional Swing icons are heavy objects whose loading may or may not succeed, and so they are not suitable for direct use in a property as part of your view model. Instead, you should use the
IconDeclaration
interface, which is a lightweight value object that merely models the resource location of the icon even if it is not yet loaded or even does not exist at all.This is especially useful in case of unit tests for you view model, where the icon may not be available at all, but you still want to test the behaviour of your view model.
- Parameters:
icon
- TheIcon
property which should be displayed on the button.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ificon
isnull
.
-
withFontSize
Use this to set the size of the font of the wrapped button type.- Parameters:
size
- The size of the font which should be displayed on the button.- Returns:
- This very builder to allow for method chaining.
-
withFontSize
Use this to dynamically set the size of the font of the wrapped button type through the provided view model property. When the integer wrapped by the provided property changes, then so does the font size of the text displayed on this button.- Parameters:
size
- The size property of the font which should be displayed on the button.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifsize
isnull
.
-
withFont
Use this to set the font of the wrapped button type.- Parameters:
font
- The font of the text which should be displayed on the button.- Returns:
- This builder instance, to allow for method chaining.
- Throws:
IllegalArgumentException
- iffont
isnull
.
-
withFont
Use this to dynamically set the font of the wrapped button type through the provided view model property. When the font wrapped by the provided property changes, then so does the font of the text displayed on this button.- Parameters:
font
- The font property of the text which should be displayed on the button type.- Returns:
- This builder instance, to allow for method chaining.
- Throws:
IllegalArgumentException
- iffont
isnull
.IllegalArgumentException
- iffont
is a property which can wrapnull
.
-
isSelectedIf
Use this to set the selection state of the wrapped button type.- Parameters:
isSelected
- The selection state of the wrapped button type, which translates toAbstractButton.setSelected(boolean)
.- Returns:
- This builder instance, to allow for method chaining.
-
isSelectedIf
Use this to bind to aVar
instance which will be used to dynamically model the selection state of the wrappedAbstractButton
type.- Parameters:
selected
- TheVar
instance which will be used to model the selection state of the wrapped button type.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifselected
isnull
.
-
isSelectedIfNot
Use this to bind to aVar
instance which will be used to dynamically model the inverse selection state of the wrappedAbstractButton
type.- Parameters:
selected
- TheVar
instance which will be used to model the inverse selection state of the wrapped button type.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifselected
isnull
.
-
isSelectedIf
Use this to bind to aVar
instance which will be used to dynamically model the selection state of the wrappedAbstractButton
type.- Parameters:
selected
- TheVar
instance which will be used to model the selection state of the wrapped button type.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifselected
isnull
.
-
isSelectedIfNot
Use this to dynamically bind to aVar
instance which will be used to dynamically model the inverse selection state of the wrappedAbstractButton
type.- Parameters:
selected
- TheVar
instance which will be used to model the inverse selection state of the wrapped button type.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifselected
isnull
.
-
isSelectedIf
Use this to dynamically bind the selection flag of the button to aVal
property which will determine the selection state of the button based on the equality of the property value and the provided reference value. So if the firststate
argument is equal to the value of theselection
property, the button will be selected, otherwise it will be deselected.
A typical use case is to bind a button to an enum property, like so:
As you can see, the radio button will be selected if the enum property is equal to the supplied enum value and deselected otherwise.// In your view model: enum Step { ONE, TWO, THREE } Var<Step> step = Var.of(Step.ONE); // In your view: UI.radioButton("Two").isSelectedIf(Step.TWO, vm.getStep());
Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to send the property value to this view component.- Type Parameters:
T
- The type of the property value.- Parameters:
state
- The reference value which the button type should represent when selected.selection
- TheVal
instance which will be used to dynamically model the selection state of the wrapped button type based on the equality of thestate
argument and the value of the property.- Returns:
- The current builder type, to allow for further method chaining.
- Throws:
IllegalArgumentException
- ifselected
isnull
.
-
isSelectedIfNot
This is the inverse ofisSelectedIf(Object, Val)
. Use this to make the wrapped UI component dynamically deselected or selected, based on the equality between the supplied value and the property value.
Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to send the property value to this view component.
A typical use case is to bind to an enum property, like so:
As you can see, the radio button will be selected if the enum property is equal to the supplied enum value and deselected otherwise.// In your view model: enum Step { ONE, TWO, THREE } Var<Step> step = Var.of(Step.ONE); // In your view: UI.radioButton("Not Two") .isSelectedIfNot(Step.TWO, vm.getStep());
- Type Parameters:
T
- The type of the value.- Parameters:
state
- The value which, if equal to the supplied property value, makes the UI component deselected.selection
- The enum property which, if equal to the supplied value, makes the UI component deselected.- Returns:
- This very instance, which enables builder-style method chaining.
-
isPressedIf
Use this to dynamically bind to aVar
instance which will be used to dynamically model the pressed state of the wrappedAbstractButton
type.- Parameters:
var
- TheVar
instance which will be used to model the pressed state of the wrapped button type.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifvar
isnull
.
-
_onModelChange
-
isBorderPaintedIf
Sets theAbstractButton.setBorderPainted(boolean)
flag of the wrapped button type. If the flag is set to true, the border of the button will be painted. The default value for the borderPainted property is true. Some look and feels might not support the borderPainted property, in which case they ignore this.- Parameters:
borderPainted
- Whether the border of the button should be painted.- Returns:
- This very instance, which enables builder-style method chaining.
-
isBorderPaintedIf
Binds the providedVal
property to theAbstractButton.setBorderPainted(boolean)
method., which means that whenever the value of the property changes, the border of the button will be painted or not. The default value for the borderPainted property is true. Some look and feels might not support the borderPainted property, in which case they ignore this.- Parameters:
val
- Whether the border of the button should be painted.- Returns:
- This very instance, which enables builder-style method chaining.
-
makePlain
Effectively removes the native style of this button. Without an icon or text, one will not be able to recognize the button. Use this for buttons with a custom icon or clickable text!- Returns:
- This very instance, which enables builder-style method chaining.
-
onChange
- Parameters:
action
- The change action lambda which will be passed to the button component.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifaction
isnull
.
-
_onChange
-
onClick
This method enables a more readable way of addingActionListener
instances to button types. Additionally, to the other "onClick" method this method enables the involvement of theJComponent
itself into the action supplied to it. This is very useful for changing the state of the JComponent when the action is being triggered.- Parameters:
action
- anAction
instance which will receive anComponentDelegate
containing important context information.- Returns:
- This very instance, which enables builder-style method chaining.
- Throws:
IllegalArgumentException
- ifaction
isnull
.
-
_onClick
-
withHorizontalAlignment
A convenience method to avoid peeking into this builder like so:
This sets the horizontal alignment of the icon and text.UI.button("Clickable!") .peek( button -> button.setHorizontalAlignment(...) );
- Parameters:
horizontalAlign
- The horizontal alignment which should be applied to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifhorizontalAlign
isnull
.
-
withHorizontalAlignment
A convenience method to avoid peeking into this builder like so:
This sets the horizontal alignment of the icon and text and also binds the provided property to the underlying component.UI.button("Clickable!") .peek( button -> { property.onSetItem(v->button.setHorizontalAlignment(v.forSwing())); button.setHorizontalAlignment(property.get().forSwing()); });
Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to send the property value to this view component.- Parameters:
horizontalAlign
- The horizontal alignment property which should be bound to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifhorizontalAlign
isnull
.
-
withVerticalAlignment
A convenience method to avoid peeking into this builder like so:
This sets the vertical alignment of the icon and text.UI.button("Clickable!") .peek( button -> button.setVerticalAlignment(...) );
- Parameters:
verticalAlign
- The vertical alignment which should be applied to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifverticalAlign
isnull
.
-
withVerticalAlignment
A convenience method to avoid peeking into this builder like so:
This sets the vertical alignment of the icon and text and also binds the provided property to the underlying component.UI.button("Clickable!") .peek( button -> { property.onSetItem(v->button.setVerticalAlignment(v.forSwing())); button.setVerticalAlignment(property.get().forSwing()); });
Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to send the property value to this view component.- Parameters:
verticalAlign
- The vertical alignment property which should be bound to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifverticalAlign
isnull
.
-
withHorizontalTextAlignment
A convenience method to avoid peeking into this builder like so:
This sets the horizontal position of the text relative to the icon.UI.button("Clickable!") .peek( button -> button.setHorizontalTextPosition(...) );
- Parameters:
horizontalAlign
- The horizontal text alignment relative to the icon which should be applied to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifhorizontalAlign
isnull
.
-
withHorizontalTextAlignment
A convenience method to avoid peeking into this builder like so:
This sets the horizontal position of the text relative to the icon and also binds the provided property to the underlying component.UI.button("Clickable!") .peek( button -> { property.onSetItem(v->button.setHorizontalTextPosition(v.forSwing())); button.setHorizontalTextPosition(property.get().forSwing()); });
Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to send the property value to this view component.- Parameters:
horizontalAlign
- The horizontal text alignment property relative to the icon which should be bound to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifhorizontalAlign
isnull
.
-
withVerticalTextAlignment
A convenience method to avoid peeking into this builder like so:
This sets the vertical position of the text relative to the icon.UI.button("Clickable!") .peek( button -> button.setVerticalTextPosition(...) );
- Parameters:
verticalAlign
- The vertical text alignment relative to the icon which should be applied to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifverticalAlign
isnull
.
-
withVerticalTextAlignment
A convenience method to avoid peeking into this builder like so:
This sets the vertical position of the text relative to the icon and also binds the provided property to the underlying component.UI.button("Clickable!") .peek( button -> { property.onSetItem(v->button.setVerticalTextPosition(v.forSwing())); button.setVerticalTextPosition(property.get().forSwing()); });
Hint: UsemyProperty.fire(From.VIEW_MODEL)
in your view model to send the property value to this view component.- Parameters:
verticalAlign
- The vertical text alignment property relative to the icon which should be bound to the underlying component.- Returns:
- This very builder to allow for method chaining.
- Throws:
IllegalArgumentException
- ifverticalAlign
isnull
.
-
withButtonGroup
Use this to attach this button type to a button group.- Parameters:
group
- The button group to which this button should be attached.- Returns:
- This very builder to allow for method chaining.
-
withMargin
Use this to set the margin of the wrapped button type.- Parameters:
insets
- The margin of the button.- Returns:
- This very builder to allow for method chaining.
-
withMargin
Use this to set the margin of the wrapped button type.- Parameters:
top
- The top margin of the button.left
- The left margin of the button.bottom
- The bottom margin of the button.right
- The right margin of the button.- Returns:
- This very builder to allow for method chaining.
-