Package io.jmix.ui.action
Class DialogAction
java.lang.Object
io.jmix.ui.action.AbstractAction
io.jmix.ui.action.BaseAction
io.jmix.ui.action.DialogAction
- All Implemented Interfaces:
- Action,- Action.HasPrimaryState,- Action.SecuredAction
Standard action for option dialogs.
 
You can use fluent API to create instances of DialogAction and assign handlers to them:
You can use fluent API to create instances of DialogAction and assign handlers to them:
     showOptionDialog(
             "Select options",
             "Do you want to print all rows?",
             MessageType.CONFIRMATION,
             new Action[]{
                     new DialogAction(Type.YES).withHandler(event -> {
                         // add action logic here
                     }),
                     new DialogAction(Type.NO)
                             .withCaption("Print selected")
                             .withIcon(JmixIcon.PRINT.source())
                             .withStyleName("print-selected")
                             .withHandler(event -> {
                         // add action logic here
                     }),
                     new DialogAction(Type.CANCEL)
             });
 - See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class io.jmix.ui.action.BaseActionBaseAction.EnabledRuleNested classes/interfaces inherited from interface io.jmix.ui.action.ActionAction.ActionPerformedEvent, Action.AdjustWhenScreenReadOnly, Action.ExecutableAction, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.MainTabSheetAction, Action.ScreenOpeningAction, Action.SecuredAction, Action.Status
- 
Field SummaryFieldsFields inherited from class io.jmix.ui.action.AbstractActioncaption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visibleFields inherited from interface io.jmix.ui.action.ActionPROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE
- 
Constructor SummaryConstructorsConstructorDescriptionDialogAction(DialogAction.Type type, boolean primary) DialogAction(DialogAction.Type type, Action.Status status) DialogAction(String id) 
- 
Method SummaryModifier and TypeMethodDescriptiongetType()withCaption(String caption) Set caption using fluent API method.withDescription(String description) Set description using fluent API method.withHandler(Consumer<Action.ActionPerformedEvent> handler) Set action performed event handler using fluent API method.Set icon using fluent API method.withPrimary(boolean primary) Set whether this action is primary using fluent API method.withShortcut(String shortcut) Set shortcut using fluent API method.withStyleName(String styleName) Sets style name that will be used in the corresponding button of the dialog.Methods inherited from class io.jmix.ui.action.BaseActionactionPerform, addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternalMethods inherited from class io.jmix.ui.action.AbstractActionaddOwner, addPropertyChangeListener, firePropertyChange, getCaption, getDescription, getEventHub, getIcon, getId, getOwner, getOwners, getShortcutCombination, hasSubscriptions, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setPrimary, setShortcut, setShortcutCombinationMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.action.ActionaddOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setShortcut, setShortcutCombination
- 
Field Details- 
type
- 
styleName
 
- 
- 
Constructor Details- 
DialogAction
- 
DialogAction
- 
DialogAction
- 
DialogAction
 
- 
- 
Method Details- 
getType
- 
getStyleName- Returns:
- style name or nullif not set
 
- 
withStyleNameSets style name that will be used in the corresponding button of the dialog.- Parameters:
- styleName- style name
- Returns:
- current instance of action
 
- 
withCaptionSet caption using fluent API method.- Overrides:
- withCaptionin class- BaseAction
- Parameters:
- caption- caption
- Returns:
- current instance of action
 
- 
withDescriptionSet description using fluent API method.- Overrides:
- withDescriptionin class- BaseAction
- Parameters:
- description- description
- Returns:
- current instance of action
 
- 
withIconSet icon using fluent API method.- Overrides:
- withIconin class- BaseAction
- Parameters:
- icon- icon
- Returns:
- current instance of action
 
- 
withShortcutSet shortcut using fluent API method.- Overrides:
- withShortcutin class- BaseAction
- Parameters:
- shortcut- shortcut
- Returns:
- current instance of action
 
- 
withHandlerSet action performed event handler using fluent API method. Can be used instead of subclassing BaseAction class.- Overrides:
- withHandlerin class- BaseAction
- Parameters:
- handler- action performed handler
- Returns:
- current instance of action
 
- 
withPrimarySet whether this action is primary using fluent API method. Can be used instead of subclassing BaseAction class.- Overrides:
- withPrimaryin class- BaseAction
- Parameters:
- primary- primary
- Returns:
- current instance of action
 
 
-