Package io.jmix.ui.component
Interface Button
- All Superinterfaces:
ActionOwner
,Component
,Component.BelongToFrame
,Component.Focusable
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
- All Known Subinterfaces:
LinkButton
- All Known Implementing Classes:
ButtonImpl
,LinkButtonImpl
,PaletteButton
@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%/ui/vcl/components/button.html")
public interface Button
extends Component, Component.HasCaption, Component.BelongToFrame, ActionOwner, Component.HasIcon, Component.Focusable, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Event sent when the button is clicked.Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionaddClickListener
(Consumer<Button.ClickEvent> listener) void
click()
Simulates a button click, notifying all server-side listeners.boolean
void
setDisableOnClick
(boolean disableOnClick) Determines if a button is automatically disabled when clicked.void
setShortcut
(String shortcut) Sets shortcut from string representation.void
setShortcutCombination
(KeyCombination shortcut) Sets shortcut combination.Methods inherited from interface io.jmix.ui.component.ActionOwner
getAction, setAction, setAction
Methods inherited from interface io.jmix.ui.component.Component
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
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndex
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
setDisableOnClick
Determines if a button is automatically disabled when clicked. If this is set to true the button will be automatically disabled when clicked, typically to prevent (accidental) extra clicks on a button.- Parameters:
disableOnClick
- disable on click option.
-
isDisableOnClick
boolean isDisableOnClick()- Returns:
- true if the button is disabled when clicked.
-
getShortcutCombination
- Returns:
- action's shortcut
-
setShortcutCombination
Sets shortcut combination.- Parameters:
shortcut
- key combination
-
setShortcut
Sets shortcut from string representation.- Parameters:
shortcut
- string of type "Modifiers-Key", e.g. "Alt-N". Case-insensitive.
-
click
void click()Simulates a button click, notifying all server-side listeners.No action is taken if the button is disabled.
-
addClickListener
-