public class PopupButtonImpl extends AbstractComponent<JmixPopupButton> implements PopupButton, SecuredActionsHolder
Modifier and Type | Class and Description |
---|---|
protected class |
PopupButtonImpl.PopupMenuButton |
PopupButton.PopupOpenDirection, PopupButton.PopupVisibilityEvent
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
HasContextHelp.ContextHelpIconClickEvent
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<Action,com.vaadin.ui.Button> |
actionButtons |
protected java.util.List<Action> |
actionOrder |
protected java.util.function.Consumer<java.beans.PropertyChangeEvent> |
actionPropertyChangeListener |
protected ActionsPermissions |
actionsPermissions |
protected static java.lang.String |
CONTEXT_MENU_BUTTON_STYLENAME |
protected Component |
popupComponent |
protected com.vaadin.shared.Registration |
popupVisibilityListenerRegistration |
protected boolean |
showActionIcons |
protected JmixPopupButtonLayout |
vActionsContainer |
protected com.vaadin.ui.Component |
vPopupComponent |
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parent
NAME
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
Constructor and Description |
---|
PopupButtonImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
actionPropertyChanged(java.beans.PropertyChangeEvent evt) |
void |
addAction(Action action)
Add an action to the component
|
void |
addAction(Action action,
int index)
Add an action to the component with index.
|
io.jmix.core.common.event.Subscription |
addPopupVisibilityListener(java.util.function.Consumer<PopupButton.PopupVisibilityEvent> listener) |
protected JmixButton |
createActionButton(Action action) |
protected JmixPopupButtonLayout |
createActionsContainer() |
protected JmixPopupButton |
createComponent() |
void |
focus()
Sets focus to this component
|
Action |
getAction(java.lang.String id) |
java.util.Collection<Action> |
getActions() |
ActionsPermissions |
getActionsPermissions() |
float |
getMenuWidth() |
SizeUnit |
getMenuWidthSizeUnit()
Gets the menu width property units.
|
Component |
getPopupContent() |
PopupButton.PopupOpenDirection |
getPopupOpenDirection() |
int |
getTabIndex()
Gets the tabulator index of the
HasTabIndex component. |
protected boolean |
hasVisibleActions() |
protected void |
internalRemovePopupVisibilityListener(java.util.function.Consumer<PopupButton.PopupVisibilityEvent> listener) |
boolean |
isAutoClose() |
boolean |
isClosePopupOnOutsideClick() |
boolean |
isPopupVisible() |
boolean |
isShowActionIcons()
Returns show icons for action buttons
|
boolean |
isTogglePopupVisibilityOnClick() |
void |
removeAction(Action action)
Remove the action from the component
|
void |
removeAction(java.lang.String id)
Remove the action by its ID.
|
void |
removeAllActions()
Remove all actions from the component
|
void |
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(java.lang.String id)
INTERNAL.
|
void |
setMenuWidth(java.lang.String width)
Sets menu width.
|
protected void |
setPopupButtonAction(JmixButton button,
Action action) |
protected void |
setPopupButtonIcon(com.vaadin.ui.Button button,
java.lang.String icon) |
void |
setPopupContent(Component popupContent)
Sets custom inner content for the popup.
|
void |
setPopupOpenDirection(PopupButton.PopupOpenDirection direction)
Sets opening direction for the popup.
|
void |
setPopupVisible(boolean popupVisible)
Open or close popup panel.
|
void |
setShowActionIcons(boolean showActionIcons)
Sets show icons for action buttons
|
void |
setTabIndex(int tabIndex)
Sets the tabulator index of the
Focusable component. |
void |
setThemeConstantsManager(ThemeConstantsManager themeConstantsManager) |
void |
setTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick)
Sets sequential click on popup will toggle popup visibility.
|
protected void |
updateActionsIcons() |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFrame, setFrame
getIcon, setIcon, setIconFromSet
isFocusable, setFocusable
isCaptionAsHtml, setCaptionAsHtml
getCaption, setCaption
getDescription, setDescription
isDescriptionAsHtml, setDescriptionAsHtml
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
getActionNN, getSubPart
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
protected static final java.lang.String CONTEXT_MENU_BUTTON_STYLENAME
protected Component popupComponent
protected com.vaadin.ui.Component vPopupComponent
protected JmixPopupButtonLayout vActionsContainer
protected boolean showActionIcons
protected java.util.List<Action> actionOrder
protected java.util.Map<Action,com.vaadin.ui.Button> actionButtons
protected ActionsPermissions actionsPermissions
protected com.vaadin.shared.Registration popupVisibilityListenerRegistration
protected java.util.function.Consumer<java.beans.PropertyChangeEvent> actionPropertyChangeListener
@Autowired public void setThemeConstantsManager(ThemeConstantsManager themeConstantsManager)
protected JmixPopupButton createComponent()
protected JmixPopupButtonLayout createActionsContainer()
protected boolean hasVisibleActions()
public io.jmix.core.common.event.Subscription addPopupVisibilityListener(java.util.function.Consumer<PopupButton.PopupVisibilityEvent> listener)
addPopupVisibilityListener
in interface PopupButton
protected void internalRemovePopupVisibilityListener(java.util.function.Consumer<PopupButton.PopupVisibilityEvent> listener)
public void focus()
Component.Focusable
focus
in interface Component.Focusable
public int getTabIndex()
Component.Focusable
HasTabIndex
component.getTabIndex
in interface Component.Focusable
HasTabIndex
componentpublic void setTabIndex(int tabIndex)
Component.Focusable
Focusable
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.setTabIndex
in interface Component.Focusable
tabIndex
- tab indexpublic boolean isPopupVisible()
isPopupVisible
in interface PopupButton
public void setPopupVisible(boolean popupVisible)
PopupButton
setPopupVisible
in interface PopupButton
popupVisible
- whether open or close popup panel.public void setMenuWidth(@Nullable java.lang.String width)
PopupButton
setMenuWidth
in interface PopupButton
width
- new menu widthpublic float getMenuWidth()
getMenuWidth
in interface PopupButton
public SizeUnit getMenuWidthSizeUnit()
PopupButton
getMenuWidthSizeUnit
in interface PopupButton
public boolean isAutoClose()
isAutoClose
in interface PopupButton
public void setShowActionIcons(boolean showActionIcons)
PopupButton
setShowActionIcons
in interface PopupButton
public boolean isShowActionIcons()
PopupButton
isShowActionIcons
in interface PopupButton
public boolean isTogglePopupVisibilityOnClick()
isTogglePopupVisibilityOnClick
in interface PopupButton
public void setTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick)
PopupButton
setTogglePopupVisibilityOnClick
in interface PopupButton
togglePopupVisibilityOnClick
- true if sequential click on popup should toggle popup visibilitypublic PopupButton.PopupOpenDirection getPopupOpenDirection()
getPopupOpenDirection
in interface PopupButton
public void setPopupOpenDirection(PopupButton.PopupOpenDirection direction)
PopupButton
setPopupOpenDirection
in interface PopupButton
direction
- new directionpublic boolean isClosePopupOnOutsideClick()
isClosePopupOnOutsideClick
in interface PopupButton
public void setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick)
PopupButton
setClosePopupOnOutsideClick
in interface PopupButton
closePopupOnOutsideClick
- whether to close popup on outside clickpublic void setPopupContent(@Nullable Component popupContent)
PopupButton
setPopupContent
in interface PopupButton
popupContent
- popup component.@Nullable public Component getPopupContent()
getPopupContent
in interface PopupButton
public void setAutoClose(boolean autoClose)
PopupButton
setAutoClose
in interface PopupButton
autoClose
- whether to close menu automatically after action triggering or notpublic void addAction(Action action)
ActionsHolder
addAction
in interface ActionsHolder
public void addAction(Action action, int index)
ActionsHolder
addAction
in interface ActionsHolder
protected void updateActionsIcons()
protected JmixButton createActionButton(Action action)
protected void setPopupButtonAction(JmixButton button, Action action)
protected void setPopupButtonIcon(com.vaadin.ui.Button button, @Nullable java.lang.String icon)
protected void actionPropertyChanged(java.beans.PropertyChangeEvent evt)
public void setDebugId(@Nullable java.lang.String id)
HasDebugId
setDebugId
in interface HasDebugId
setDebugId
in class AbstractComponent<JmixPopupButton>
public void removeAction(Action action)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAction(java.lang.String id)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAllActions()
ActionsHolder
removeAllActions
in interface ActionsHolder
@Nullable public Action getAction(java.lang.String id)
getAction
in interface ActionsHolder
public java.util.Collection<Action> getActions()
getActions
in interface ActionsHolder
public ActionsPermissions getActionsPermissions()
getActionsPermissions
in interface SecuredActionsHolder