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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classEvent 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
FieldsFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Method Summary
Modifier and TypeMethodDescriptionaddClickListener(Consumer<Button.ClickEvent> listener) voidclick()Simulates a button click, notifying all server-side listeners.booleanvoidsetDisableOnClick(boolean disableOnClick) Determines if a button is automatically disabled when clicked.voidsetShortcut(String shortcut) Sets shortcut from string representation.voidsetShortcutCombination(KeyCombination shortcut) Sets shortcut combination.Methods inherited from interface io.jmix.ui.component.ActionOwner
getAction, setAction, setActionMethods 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, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.Focusable
focus, getTabIndex, isFocusable, setFocusable, setTabIndexMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods 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
-