Package io.jmix.ui.component.impl
Class PopupButtonImpl
java.lang.Object
io.jmix.ui.component.impl.AbstractComponent<JmixPopupButton>
io.jmix.ui.component.impl.PopupButtonImpl
- All Implemented Interfaces:
ActionsHolder,AttachNotifier,Component,Component.BelongToFrame,Component.Focusable,Component.HasCaption,Component.HasDescription,Component.HasIcon,Component.HasXmlDescriptor,Component.Wrapper,HasContextHelp,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,HasSubParts,PopupButton,SecuredActionsHolder
- Direct Known Subclasses:
RelatedEntitiesImpl
public class PopupButtonImpl
extends AbstractComponent<JmixPopupButton>
implements PopupButton, SecuredActionsHolder
-
Nested Class Summary
Nested ClassesNested 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.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEventNested classes/interfaces inherited from interface io.jmix.ui.component.PopupButton
PopupButton.PopupOpenDirection, PopupButton.PopupVisibilityEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Consumer<PropertyChangeEvent>protected ActionsPermissionsprotected static final Stringprotected Componentprotected com.vaadin.shared.Registrationprotected booleanprotected JmixPopupButtonLayoutprotected com.vaadin.ui.ComponentFields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parentFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZEFields inherited from interface io.jmix.ui.component.PopupButton
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidAdd an action to the componentvoidAdd an action to the component with index.protected JmixButtoncreateActionButton(Action action) protected JmixPopupButtonLayoutprotected JmixPopupButtonvoidfocus()Sets focus to this componentfloatGets the menu width property units.intGets the tabulator index of theHasTabIndexcomponent.protected booleanprotected voidbooleanbooleanbooleanbooleanReturns show icons for action buttonsbooleanvoidremoveAction(Action action) Remove the action from the componentvoidremoveAction(String id) Remove the action by its ID.voidRemove all actions from the componentvoidsetAutoClose(boolean autoClose) Sets menu automatic close after option click.voidsetClosePopupOnOutsideClick(boolean closePopupOnOutsideClick) If set to true, clicking on outside the popup closes it.voidsetDebugId(String id) INTERNAL.voidsetMenuWidth(String width) Sets menu width.protected voidsetPopupButtonAction(JmixButton button, Action action) protected voidsetPopupButtonIcon(com.vaadin.ui.Button button, String icon) voidsetPopupContent(Component popupContent) Sets custom inner content for the popup.voidSets opening direction for the popup.voidsetPopupVisible(boolean popupVisible) Open or close popup panel.voidsetShowActionIcons(boolean showActionIcons) Sets show icons for action buttonsvoidsetTabIndex(int tabIndex) Sets the tabulator index of theFocusablecomponent.voidsetThemeConstantsManager(ThemeConstantsManager themeConstantsManager) voidsetTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick) Sets sequential click on popup will toggle popup visibility.protected voidMethods inherited from class io.jmix.ui.component.impl.AbstractComponent
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setResponsive, setStyleName, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.component.ActionsHolder
getActionNN, getSubPartMethods 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
isFocusable, setFocusableMethods 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
-
CONTEXT_MENU_BUTTON_STYLENAME
- See Also:
-
popupComponent
-
vPopupComponent
protected com.vaadin.ui.Component vPopupComponent -
vActionsContainer
-
showActionIcons
protected boolean showActionIcons -
actionOrder
-
actionButtons
-
actionsPermissions
-
popupVisibilityListenerRegistration
protected com.vaadin.shared.Registration popupVisibilityListenerRegistration -
actionPropertyChangeListener
-
-
Constructor Details
-
PopupButtonImpl
public PopupButtonImpl()
-
-
Method Details
-
setThemeConstantsManager
-
createComponent
-
createActionsContainer
-
hasVisibleActions
protected boolean hasVisibleActions() -
addPopupVisibilityListener
- Specified by:
addPopupVisibilityListenerin interfacePopupButton
-
internalRemovePopupVisibilityListener
protected void internalRemovePopupVisibilityListener(Consumer<PopupButton.PopupVisibilityEvent> listener) -
focus
public void focus()Description copied from interface:Component.FocusableSets focus to this component- Specified by:
focusin interfaceComponent.Focusable
-
getTabIndex
public int getTabIndex()Description copied from interface:Component.FocusableGets the tabulator index of theHasTabIndexcomponent.- Specified by:
getTabIndexin interfaceComponent.Focusable- Returns:
- tab index set for the
HasTabIndexcomponent
-
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.FocusableSets the tabulator index of theFocusablecomponent. The tab index property is used to specify the order in which the fields are focused when the user presses the Tab key. Components with a defined tab index are focused sequentially first, and then the components with no tab index.- Specified by:
setTabIndexin interfaceComponent.Focusable- Parameters:
tabIndex- tab index
-
isPopupVisible
public boolean isPopupVisible()- Specified by:
isPopupVisiblein interfacePopupButton- Returns:
- true if popup is opened
-
setPopupVisible
public void setPopupVisible(boolean popupVisible) Description copied from interface:PopupButtonOpen or close popup panel.- Specified by:
setPopupVisiblein interfacePopupButton- Parameters:
popupVisible- whether open or close popup panel.
-
setMenuWidth
Description copied from interface:PopupButtonSets menu width.- Specified by:
setMenuWidthin interfacePopupButton- Parameters:
width- new menu width
-
getMenuWidth
public float getMenuWidth()- Specified by:
getMenuWidthin interfacePopupButton- Returns:
- menu width
-
getMenuWidthSizeUnit
Description copied from interface:PopupButtonGets the menu width property units.- Specified by:
getMenuWidthSizeUnitin interfacePopupButton- Returns:
- units used in the menu width property.
-
isAutoClose
public boolean isAutoClose()- Specified by:
isAutoClosein interfacePopupButton- Returns:
- whether to close menu automatically after action triggering or not
-
setShowActionIcons
public void setShowActionIcons(boolean showActionIcons) Description copied from interface:PopupButtonSets show icons for action buttons- Specified by:
setShowActionIconsin interfacePopupButton
-
isShowActionIcons
public boolean isShowActionIcons()Description copied from interface:PopupButtonReturns show icons for action buttons- Specified by:
isShowActionIconsin interfacePopupButton
-
isTogglePopupVisibilityOnClick
public boolean isTogglePopupVisibilityOnClick()- Specified by:
isTogglePopupVisibilityOnClickin interfacePopupButton- Returns:
- if sequential click on popup will toggle popup visibility
-
setTogglePopupVisibilityOnClick
public void setTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick) Description copied from interface:PopupButtonSets sequential click on popup will toggle popup visibility.- Specified by:
setTogglePopupVisibilityOnClickin interfacePopupButton- Parameters:
togglePopupVisibilityOnClick- true if sequential click on popup should toggle popup visibility
-
getPopupOpenDirection
- Specified by:
getPopupOpenDirectionin interfacePopupButton- Returns:
- opening direction for the popup
-
setPopupOpenDirection
Description copied from interface:PopupButtonSets opening direction for the popup.- Specified by:
setPopupOpenDirectionin interfacePopupButton- Parameters:
direction- new direction
-
isClosePopupOnOutsideClick
public boolean isClosePopupOnOutsideClick()- Specified by:
isClosePopupOnOutsideClickin interfacePopupButton- Returns:
- true if a click outside the popup closing the popup, otherwise - false
-
setClosePopupOnOutsideClick
public void setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick) Description copied from interface:PopupButtonIf set to true, clicking on outside the popup closes it. Note that this doesn't affect clicking on the button itself.- Specified by:
setClosePopupOnOutsideClickin interfacePopupButton- Parameters:
closePopupOnOutsideClick- whether to close popup on outside click
-
setPopupContent
Description copied from interface:PopupButtonSets custom inner content for the popup. Actions are ignored if a custom popup content is set.- Specified by:
setPopupContentin interfacePopupButton- Parameters:
popupContent- popup component.
-
getPopupContent
- Specified by:
getPopupContentin interfacePopupButton- Returns:
- popup content component
-
setAutoClose
public void setAutoClose(boolean autoClose) Description copied from interface:PopupButtonSets menu automatic close after option click.- Specified by:
setAutoClosein interfacePopupButton- Parameters:
autoClose- whether to close menu automatically after action triggering or not
-
addAction
Description copied from interface:ActionsHolderAdd an action to the component- Specified by:
addActionin interfaceActionsHolder
-
addAction
Description copied from interface:ActionsHolderAdd an action to the component with index.- Specified by:
addActionin interfaceActionsHolder
-
updateActionsIcons
protected void updateActionsIcons() -
createActionButton
-
setPopupButtonAction
-
setPopupButtonIcon
-
actionPropertyChanged
-
setDebugId
Description copied from interface:HasDebugIdINTERNAL. Managed by debug Id system.- Specified by:
setDebugIdin interfaceHasDebugId- Overrides:
setDebugIdin classAbstractComponent<JmixPopupButton>
-
removeAction
Description copied from interface:ActionsHolderRemove the action from the component- Specified by:
removeActionin interfaceActionsHolder
-
removeAction
Description copied from interface:ActionsHolderRemove the action by its ID. If there is no action with that ID, nothing happens.- Specified by:
removeActionin interfaceActionsHolder
-
removeAllActions
public void removeAllActions()Description copied from interface:ActionsHolderRemove all actions from the component- Specified by:
removeAllActionsin interfaceActionsHolder
-
getAction
- Specified by:
getActionin interfaceActionsHolder- Returns:
- an action by its ID, or null if not found
-
getActions
- Specified by:
getActionsin interfaceActionsHolder- Returns:
- unmodifiable collection of actions
-
getActionsPermissions
- Specified by:
getActionsPermissionsin interfaceSecuredActionsHolder- Returns:
- permissions container
-