@StudioComponent(caption="Button", category="Components", xmlElement="button", icon="io/jmix/ui/icon/component/button.svg", canvasTextProperty="caption", canvasBehaviour=BUTTON, documentationURL="https://docs.jmix.io/jmix/%VERSION%/backoffice-ui/vcl/components/button.html") public interface Button extends Component, Component.HasCaption, Component.BelongToFrame, ActionOwner, Component.HasIcon, Component.Focusable, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
Modifier and Type | Interface and Description |
---|---|
static class |
Button.ClickEvent
Event sent when the button is clicked.
|
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Modifier and Type | Method and Description |
---|---|
io.jmix.core.common.event.Subscription |
addClickListener(java.util.function.Consumer<Button.ClickEvent> listener) |
void |
click()
Simulates a button click, notifying all server-side listeners.
|
KeyCombination |
getShortcutCombination() |
boolean |
isDisableOnClick() |
void |
setDisableOnClick(boolean disableOnClick)
Determines if a button is automatically disabled when clicked.
|
void |
setShortcut(java.lang.String shortcut)
Sets shortcut from string representation.
|
void |
setShortcutCombination(KeyCombination shortcut)
Sets shortcut combination.
|
getFrame, setFrame
getAction, setAction, setAction
getIcon, setIcon, setIconFromSet
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
static final java.lang.String NAME
@StudioProperty(defaultValue="false") void setDisableOnClick(boolean disableOnClick)
disableOnClick
- disable on click option.boolean isDisableOnClick()
@Nullable KeyCombination getShortcutCombination()
void setShortcutCombination(@Nullable KeyCombination shortcut)
shortcut
- key combination@StudioProperty(type=SHORTCUT) void setShortcut(@Nullable java.lang.String shortcut)
shortcut
- string of type "Modifiers-Key", e.g. "Alt-N". Case-insensitive.void click()
No action is taken if the button is disabled.
io.jmix.core.common.event.Subscription addClickListener(java.util.function.Consumer<Button.ClickEvent> listener)