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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classEvent sent when the action is performed.static interfaceInterface to be implemented by actions which may adjust their 'enabled' state according to the screen read-only mode.static interfaceIndicates that the action is executable.static interfaceInterface to be implemented by actions that have primary state.static interfaceInterface defining constraintOperationType and constraintCode options.static interfacestatic interfaceAn action that can be used as Main TabSheet context menu item.static interfaceInterface to be implemented by actions that open a screen.static interfaceIndicates that the action can be affected by UI permissions.static enumUsed in dialogs to assign a special visual style for a button representing the action. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerform(Component component) Invoked by owning component to execute the action.voidaddOwner(ActionOwner actionOwner) Add an owner component.voidaddPropertyChangeListener(Consumer<PropertyChangeEvent> listener) Adds a listener to be notified about Enabled, Caption or Icon property changes.getIcon()getId()getOwner()booleanbooleanvoidRefresh internal state of the action to initialize enabled, visible, caption, icon, etc.voidremoveOwner(ActionOwner actionOwner) Remove the owner component.voidRemoves the listener.voidsetCaption(String caption) voidsetDescription(String description) voidsetEnabled(boolean enabled) voidvoidsetShortcut(String shortcut) Set shortcut from string representation.voidsetShortcutCombination(KeyCombination shortcut) voidsetVisible(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:
-