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 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
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
Nested classes/interfaces inherited from interface io.jmix.ui.component.PopupButton
PopupButton.PopupOpenDirection, PopupButton.PopupVisibilityEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected Consumer<PropertyChangeEvent>
protected ActionsPermissions
protected static final String
protected Component
protected com.vaadin.shared.Registration
protected boolean
protected JmixPopupButtonLayout
protected com.vaadin.ui.Component
Fields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Fields inherited from interface io.jmix.ui.component.PopupButton
NAME
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
Add an action to the componentvoid
Add an action to the component with index.protected JmixButton
createActionButton
(Action action) protected JmixPopupButtonLayout
protected JmixPopupButton
void
focus()
Sets focus to this componentfloat
Gets the menu width property units.int
Gets the tabulator index of theHasTabIndex
component.protected boolean
protected void
boolean
boolean
boolean
boolean
Returns show icons for action buttonsboolean
void
removeAction
(Action action) Remove the action from the componentvoid
removeAction
(String id) Remove the action by its ID.void
Remove all actions from the componentvoid
setAutoClose
(boolean autoClose) Sets menu automatic close after option click.void
setClosePopupOnOutsideClick
(boolean closePopupOnOutsideClick) If set to true, clicking on outside the popup closes it.void
setDebugId
(String id) INTERNAL.void
setMenuWidth
(String width) Sets menu width.protected void
setPopupButtonAction
(JmixButton button, Action action) protected void
setPopupButtonIcon
(com.vaadin.ui.Button button, String icon) void
setPopupContent
(Component popupContent) Sets custom inner content for the popup.void
Sets opening direction for the popup.void
setPopupVisible
(boolean popupVisible) Open or close popup panel.void
setShowActionIcons
(boolean showActionIcons) Sets show icons for action buttonsvoid
setTabIndex
(int tabIndex) Sets the tabulator index of theFocusable
component.void
setThemeConstantsManager
(ThemeConstantsManager themeConstantsManager) void
setTogglePopupVisibilityOnClick
(boolean togglePopupVisibilityOnClick) Sets sequential click on popup will toggle popup visibility.protected void
Methods 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, withUnwrappedComposition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jmix.ui.component.ActionsHolder
getActionNN, getSubPart
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
isFocusable, setFocusable
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
-
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:
addPopupVisibilityListener
in interfacePopupButton
-
internalRemovePopupVisibilityListener
protected void internalRemovePopupVisibilityListener(Consumer<PopupButton.PopupVisibilityEvent> listener) -
focus
public void focus()Description copied from interface:Component.Focusable
Sets focus to this component- Specified by:
focus
in interfaceComponent.Focusable
-
getTabIndex
public int getTabIndex()Description copied from interface:Component.Focusable
Gets the tabulator index of theHasTabIndex
component.- Specified by:
getTabIndex
in interfaceComponent.Focusable
- Returns:
- tab index set for the
HasTabIndex
component
-
setTabIndex
public void setTabIndex(int tabIndex) Description copied from interface:Component.Focusable
Sets the tabulator index of theFocusable
component. 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:
setTabIndex
in interfaceComponent.Focusable
- Parameters:
tabIndex
- tab index
-
isPopupVisible
public boolean isPopupVisible()- Specified by:
isPopupVisible
in interfacePopupButton
- Returns:
- true if popup is opened
-
setPopupVisible
public void setPopupVisible(boolean popupVisible) Description copied from interface:PopupButton
Open or close popup panel.- Specified by:
setPopupVisible
in interfacePopupButton
- Parameters:
popupVisible
- whether open or close popup panel.
-
setMenuWidth
Description copied from interface:PopupButton
Sets menu width.- Specified by:
setMenuWidth
in interfacePopupButton
- Parameters:
width
- new menu width
-
getMenuWidth
public float getMenuWidth()- Specified by:
getMenuWidth
in interfacePopupButton
- Returns:
- menu width
-
getMenuWidthSizeUnit
Description copied from interface:PopupButton
Gets the menu width property units.- Specified by:
getMenuWidthSizeUnit
in interfacePopupButton
- Returns:
- units used in the menu width property.
-
isAutoClose
public boolean isAutoClose()- Specified by:
isAutoClose
in interfacePopupButton
- Returns:
- whether to close menu automatically after action triggering or not
-
setShowActionIcons
public void setShowActionIcons(boolean showActionIcons) Description copied from interface:PopupButton
Sets show icons for action buttons- Specified by:
setShowActionIcons
in interfacePopupButton
-
isShowActionIcons
public boolean isShowActionIcons()Description copied from interface:PopupButton
Returns show icons for action buttons- Specified by:
isShowActionIcons
in interfacePopupButton
-
isTogglePopupVisibilityOnClick
public boolean isTogglePopupVisibilityOnClick()- Specified by:
isTogglePopupVisibilityOnClick
in interfacePopupButton
- Returns:
- if sequential click on popup will toggle popup visibility
-
setTogglePopupVisibilityOnClick
public void setTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick) Description copied from interface:PopupButton
Sets sequential click on popup will toggle popup visibility.- Specified by:
setTogglePopupVisibilityOnClick
in interfacePopupButton
- Parameters:
togglePopupVisibilityOnClick
- true if sequential click on popup should toggle popup visibility
-
getPopupOpenDirection
- Specified by:
getPopupOpenDirection
in interfacePopupButton
- Returns:
- opening direction for the popup
-
setPopupOpenDirection
Description copied from interface:PopupButton
Sets opening direction for the popup.- Specified by:
setPopupOpenDirection
in interfacePopupButton
- Parameters:
direction
- new direction
-
isClosePopupOnOutsideClick
public boolean isClosePopupOnOutsideClick()- Specified by:
isClosePopupOnOutsideClick
in interfacePopupButton
- Returns:
- true if a click outside the popup closing the popup, otherwise - false
-
setClosePopupOnOutsideClick
public void setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick) Description copied from interface:PopupButton
If set to true, clicking on outside the popup closes it. Note that this doesn't affect clicking on the button itself.- Specified by:
setClosePopupOnOutsideClick
in interfacePopupButton
- Parameters:
closePopupOnOutsideClick
- whether to close popup on outside click
-
setPopupContent
Description copied from interface:PopupButton
Sets custom inner content for the popup. Actions are ignored if a custom popup content is set.- Specified by:
setPopupContent
in interfacePopupButton
- Parameters:
popupContent
- popup component.
-
getPopupContent
- Specified by:
getPopupContent
in interfacePopupButton
- Returns:
- popup content component
-
setAutoClose
public void setAutoClose(boolean autoClose) Description copied from interface:PopupButton
Sets menu automatic close after option click.- Specified by:
setAutoClose
in interfacePopupButton
- Parameters:
autoClose
- whether to close menu automatically after action triggering or not
-
addAction
Description copied from interface:ActionsHolder
Add an action to the component- Specified by:
addAction
in interfaceActionsHolder
-
addAction
Description copied from interface:ActionsHolder
Add an action to the component with index.- Specified by:
addAction
in interfaceActionsHolder
-
updateActionsIcons
protected void updateActionsIcons() -
createActionButton
-
setPopupButtonAction
-
setPopupButtonIcon
-
actionPropertyChanged
-
setDebugId
Description copied from interface:HasDebugId
INTERNAL. Managed by debug Id system.- Specified by:
setDebugId
in interfaceHasDebugId
- Overrides:
setDebugId
in classAbstractComponent<JmixPopupButton>
-
removeAction
Description copied from interface:ActionsHolder
Remove the action from the component- Specified by:
removeAction
in interfaceActionsHolder
-
removeAction
Description copied from interface:ActionsHolder
Remove the action by its ID. If there is no action with that ID, nothing happens.- Specified by:
removeAction
in interfaceActionsHolder
-
removeAllActions
public void removeAllActions()Description copied from interface:ActionsHolder
Remove all actions from the component- Specified by:
removeAllActions
in interfaceActionsHolder
-
getAction
- Specified by:
getAction
in interfaceActionsHolder
- Returns:
- an action by its ID, or null if not found
-
getActions
- Specified by:
getActions
in interfaceActionsHolder
- Returns:
- unmodifiable collection of actions
-
getActionsPermissions
- Specified by:
getActionsPermissions
in interfaceSecuredActionsHolder
- Returns:
- permissions container
-