Package io.jmix.ui.action
Interface Action
- All Known Subinterfaces:
Action.ExecutableAction
,Action.HasTarget
,Action.MainTabSheetAction
,Action.SecuredAction
- All Known Implementing Classes:
AbstractAction
,AbstractEditPresentationAction
,AbstractLookupAction
,AbstractPresentationAction
,AbstractPrintFormAction
,AddAction
,BaseAction
,BulkEditAction
,ChangePasswordAction
,ChartEditFragment.ChartSeriesMoveAction
,CreateAction
,DateIntervalAction
,DeletePresentationAction
,DialogAction
,EditAction
,EditFetchPlanAction
,EditorPrintFormAction
,EditorScreenShowEntityInfoAction
,EditPresentationAction
,EntityClearAction
,EntityInspectorBrowser.ExportAction
,EntityLookupAction
,EntityOpenAction
,EntityOpenCompositionAction
,ExcelExportAction
,ExcludeAction
,ExecutionHistoryAction
,ExportAction
,FilterAction
,FilterAddConditionAction
,FilterClearValuesAction
,FilterCopyAction
,FilterEditAction
,FilterMakeDefaultAction
,FilterRemoveAction
,FilterSaveAction
,FilterSaveAsAction
,FilterSaveWithValuesAction
,InputDialogAction
,ItemOrderableAction
,ItemTrackingAction
,JsonExportAction
,ListAction
,ListPrintFormAction
,PropertyFilterImpl.OperationChangeAction
,RefreshAction
,RelatedAction
,RemoveAction
,ReportExecutionBrowser.DownloadDocumentAction
,ResetPasswordAction
,ResetPresentationAction
,ResetRememberMeTokenAction
,RunReportAction
,SaveAsPresentationAction
,SavePresentationAction
,SecuredListAction
,ShowEntityInfoAction
,ShowPivotAction
,ShowRoleAssignmentsAction
,ShowUserSubstitutionsAction
,SubstituteUserAction
,TagLookupAction
,ValueClearAction
,ValuesSelectAction
,ViewAction
public interface Action
The
Action
interface abstracts away a function from a visual component.
The action is executed by invoking its actionPerform(Component)
method.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Event sent when the action is performed.static interface
Interface to be implemented by actions which may adjust their 'enabled' state according to the screen read-only mode.static interface
Indicates that the action is executable.static interface
Interface to be implemented by actions that have primary state.static interface
Interface defining constraintOperationType and constraintCode options.static interface
static interface
An action that can be used as Main TabSheet context menu item.static interface
Interface to be implemented by actions that open a screen.static interface
Indicates that the action can be affected by UI permissions.static enum
Used in dialogs to assign a special visual style for a button representing the action. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerform
(Component component) Invoked by owning component to execute the action.void
addOwner
(ActionOwner actionOwner) Add an owner component.void
addPropertyChangeListener
(Consumer<PropertyChangeEvent> listener) Adds a listener to be notified about Enabled, Caption or Icon property changes.getIcon()
getId()
getOwner()
boolean
boolean
void
Refresh internal state of the action to initialize enabled, visible, caption, icon, etc.void
removeOwner
(ActionOwner actionOwner) Remove the owner component.void
Removes the listener.void
setCaption
(String caption) void
setDescription
(String description) void
setEnabled
(boolean enabled) void
void
setShortcut
(String shortcut) Set shortcut from string representation.void
setShortcutCombination
(KeyCombination shortcut) void
setVisible
(boolean visible)
-
Field Details
-
PROP_CAPTION
- See Also:
-
PROP_DESCRIPTION
- See Also:
-
PROP_SHORTCUT
- See Also:
-
PROP_ICON
- See Also:
-
PROP_ENABLED
- See Also:
-
PROP_VISIBLE
- See Also:
-
-
Method Details
-
getId
String getId()- Returns:
- action's identifier
-
getCaption
- Returns:
- action's caption
-
setCaption
-
getDescription
- Returns:
- action's description
-
setDescription
-
getShortcutCombination
- Returns:
- action's keyboard shortcut
-
setShortcutCombination
-
setShortcut
Set shortcut from string representation.- Parameters:
shortcut
- string of type "Modifiers-Key", e.g. "Alt-N". Case-insensitive.
-
getIcon
- Returns:
- action's icon
-
setIcon
-
isEnabled
boolean isEnabled()- Returns:
- whether the action is currently enabled
-
setEnabled
void setEnabled(boolean enabled) -
isVisible
boolean isVisible()- Returns:
- whether the action is currently visible
-
setVisible
void setVisible(boolean visible) -
refreshState
void refreshState()Refresh internal state of the action to initialize enabled, visible, caption, icon, etc. properties depending on programmatically set values and user permissions set at runtime.For example, this method is called by visual components holding actions when they are bound to data. At this moment the action can find out what entity it is connected to and change its state according to the user permissions.
-
getOwner
- Returns:
- a single component owning the action. If there are several owners, first will be returned.
-
getOwners
Collection<ActionOwner> getOwners()- Returns:
- the collection of owners
-
addOwner
Add an owner component.- Parameters:
actionOwner
- owner component
-
removeOwner
Remove the owner component.- Parameters:
actionOwner
- owner component
-
actionPerform
Invoked by owning component to execute the action.- Parameters:
component
- invoking component
-
addPropertyChangeListener
Adds a listener to be notified about Enabled, Caption or Icon property changes.- Parameters:
listener
- a listener object
-
removePropertyChangeListener
Removes the listener.- Parameters:
listener
- a listener object- See Also:
-