Module is.codion.swing.common.ui
Interface ButtonBuilder<T,C extends AbstractButton,B extends ButtonBuilder<T,C,B>>
- Type Parameters:
T
- the value typeC
- the button typeB
- the builder type
- All Superinterfaces:
ComponentBuilder<T,
C, B>
- All Known Subinterfaces:
CheckBoxBuilder
,CheckBoxMenuItemBuilder<B>
,MenuItemBuilder<C,
,B> RadioButtonBuilder
,RadioButtonMenuItemBuilder<B>
,ToggleButtonBuilder<C,
,B> ToggleMenuItemBuilder<C,
B>
public interface ButtonBuilder<T,C extends AbstractButton,B extends ButtonBuilder<T,C,B>>
extends ComponentBuilder<T,C,B>
Builds buttons.
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
COMPONENT_VALUE, TRANSFER_FOCUS_ON_ENTER
-
Method Summary
Modifier and TypeMethodDescriptionactionListener
(ActionListener actionListener) borderPainted
(boolean borderPainted) static <B extends ButtonBuilder<Void,
JButton, B>>
ButtonBuilder<Void,JButton, B> builder()
static <B extends ButtonBuilder<Void,
JButton, B>>
ButtonBuilder<Void,JButton, B> static <B extends ButtonBuilder<Void,
JButton, B>>
ButtonBuilder<Void,JButton, B> builder
(Control.Builder<?, ?> controlBuilder) static <B extends ButtonBuilder<Void,
JButton, B>>
ButtonBuilder<Void,JButton, B> buttonGroup
(ButtonGroup buttonGroup) contentAreaFilled
(boolean contentAreaFilled) control
(Control.Builder<?, ?> controlBuilder) disabledIcon
(Icon disabledIcon) disabledSelectedIcon
(Icon disabledSelectedIcon) focusPainted
(boolean focusPainted) horizontalAlignment
(int horizontalAlignment) horizontalTextPosition
(int horizontalTextPosition) iconTextGap
(int iconTextGap) includeText
(boolean includeText) Note that setting this to false overrides the caption text from the action, if one is specified.mnemonic
(int mnemonic) multiClickThreshold
(long multiClickThreshold) pressedIcon
(Icon pressedIcon) rolloverEnabled
(boolean rolloverEnabled) rolloverIcon
(Icon rolloverIcon) rolloverSelectedIcon
(Icon rolloverSelectedIcon) selected
(boolean selected) Sets the inital selected status of the button, overridden by initial value.selectedIcon
(Icon selectedIcon) verticalAlignment
(int verticalAlignment) verticalTextPosition
(int verticalTextPosition) Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
background, border, build, build, buildValue, buildValue, clientProperty, componentListener, componentOrientation, consumer, enabled, enabled, focusable, focusCycleRoot, focusListener, font, foreground, keyEvent, keyListener, label, link, link, listener, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, onBuild, onBuildValue, onSetVisible, opaque, popupMenu, popupMenuControl, popupMenuControls, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, transferFocusOnEnter, transferHandler, validator, value, visible
-
Method Details
-
text
- Parameters:
text
- the button caption text- Returns:
- this builder instance
- See Also:
-
mnemonic
- Parameters:
mnemonic
- the mnemonic- Returns:
- this builder instance
- See Also:
-
includeText
Note that setting this to false overrides the caption text from the action, if one is specified.- Parameters:
includeText
- specifies whether a caption text should be included- Returns:
- this builder instance
-
horizontalAlignment
- Parameters:
horizontalAlignment
- the horizontal alignment- Returns:
- this builder instance
- See Also:
-
verticalAlignment
- Parameters:
verticalAlignment
- the vertical alignment- Returns:
- this builder instance
- See Also:
-
horizontalTextPosition
- Parameters:
horizontalTextPosition
- the horizontal text position- Returns:
- this builder instance
- See Also:
-
verticalTextPosition
- Parameters:
verticalTextPosition
- the vertical text position- Returns:
- this builder instance
- See Also:
-
icon
- Parameters:
icon
- the icon- Returns:
- this builder instance
- See Also:
-
pressedIcon
- Parameters:
pressedIcon
- the icon- Returns:
- this builder instance
- See Also:
-
selectedIcon
- Parameters:
selectedIcon
- the icon- Returns:
- this builder instance
- See Also:
-
rolloverIcon
- Parameters:
rolloverIcon
- the icon- Returns:
- this builder instance
- See Also:
-
rolloverSelectedIcon
- Parameters:
rolloverSelectedIcon
- the icon- Returns:
- this builder instance
- See Also:
-
disabledIcon
- Parameters:
disabledIcon
- the icon- Returns:
- this builder instance
- See Also:
-
disabledSelectedIcon
- Parameters:
disabledSelectedIcon
- the icon- Returns:
- this builder instance
- See Also:
-
iconTextGap
- Parameters:
iconTextGap
- the icon text gap- Returns:
- this builder instance
- See Also:
-
margin
- Parameters:
insets
- the margin insets- Returns:
- this builder instance
- See Also:
-
borderPainted
- Parameters:
borderPainted
- true if the border should be painted- Returns:
- this builder instance
- See Also:
-
contentAreaFilled
- Parameters:
contentAreaFilled
- true if content area should be filled- Returns:
- this builder instance
- See Also:
-
focusPainted
- Parameters:
focusPainted
- true if focus should be painted- Returns:
- this builder instance
- See Also:
-
rolloverEnabled
- Parameters:
rolloverEnabled
- true if rollover should be enabled- Returns:
- this builder instance
- See Also:
-
multiClickThreshold
- Parameters:
multiClickThreshold
- the multi click threshold- Returns:
- this builder instance
- See Also:
-
buttonGroup
- Parameters:
buttonGroup
- the group to add the button to- Returns:
- this builder instance
-
selected
Sets the inital selected status of the button, overridden by initial value.- Parameters:
selected
- the initial selected status of the button- Returns:
- this builder instance
- See Also:
-
action
- Parameters:
action
- the button action- Returns:
- this builder instance
- See Also:
-
control
- Parameters:
control
- the control to base the button on- Returns:
- this builder instance
-
control
- Parameters:
controlBuilder
- the builder for the control to base the button on- Returns:
- this builder instance
-
actionListener
- Parameters:
actionListener
- the action listener- Returns:
- this builder instance
- See Also:
-
builder
- Type Parameters:
B
- the builder type- Returns:
- a builder for a JButton
-
builder
static <B extends ButtonBuilder<Void,JButton, ButtonBuilder<Void,B>> JButton, builderB> (Action action) - Type Parameters:
B
- the builder type- Parameters:
action
- the button action- Returns:
- a builder for a JButton
-
builder
static <B extends ButtonBuilder<Void,JButton, ButtonBuilder<Void,B>> JButton, builderB> (Control control) - Type Parameters:
B
- the builder type- Parameters:
control
- the button control- Returns:
- a builder for a JButton
-
builder
static <B extends ButtonBuilder<Void,JButton, ButtonBuilder<Void,B>> JButton, builderB> (Control.Builder<?, ?> controlBuilder) - Type Parameters:
B
- the builder type- Parameters:
controlBuilder
- the button control builder- Returns:
- a builder for a JButton
-