Package io.jmix.ui.action.list
Class RelatedAction
java.lang.Object
io.jmix.ui.action.AbstractAction
io.jmix.ui.action.BaseAction
io.jmix.ui.action.ListAction
io.jmix.ui.action.list.SecuredListAction
io.jmix.ui.action.list.RelatedAction
- All Implemented Interfaces:
Action,Action.AdjustWhenScreenReadOnly,Action.ExecutableAction,Action.HasPrimaryState,Action.HasSecurityConstraint,Action.HasTarget,Action.ScreenOpeningAction,Action.SecuredAction
@StudioAction(target="io.jmix.ui.component.ListComponent",
description="Opens a browser screen with list of related entities")
@ActionType("related")
public class RelatedAction
extends SecuredListAction
implements Action.AdjustWhenScreenReadOnly, Action.ScreenOpeningAction, Action.ExecutableAction
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.ui.action.BaseAction
BaseAction.EnabledRuleNested classes/interfaces inherited from interface io.jmix.ui.action.Action
Action.ActionPerformedEvent, Action.AdjustWhenScreenReadOnly, Action.ExecutableAction, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.MainTabSheetAction, Action.ScreenOpeningAction, Action.SecuredAction, Action.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final Stringprotected MetaPropertyprotected Stringprotected RelatedEntitiesSupportprotected ActionScreenInitializerFields inherited from class io.jmix.ui.action.list.SecuredListAction
accessManager, applicationContext, constraintEntityOp, metadataFields inherited from class io.jmix.ui.action.ListAction
targetFields inherited from class io.jmix.ui.action.AbstractAction
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visibleFields inherited from interface io.jmix.ui.action.Action
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerform(Component component) Invoked by owning component to execute the action.voidexecute()Executes theActionReturns the screen open mode if it was set byAction.ScreenOpeningAction.setOpenMode(OpenMode)or in the screen XML, otherwise returnsnull.Returns the screen class if it was set byAction.ScreenOpeningAction.setScreenClass(Class)or in the screen XML, otherwise returnsnull.Returns the screen id if it was set byAction.ScreenOpeningAction.setScreenId(String)or in the screen XML, otherwise returnsnull.voidsetAfterCloseHandler(Consumer<Screen.AfterCloseEvent> afterCloseHandler) Sets the handler to be invoked when the editor screen closes.voidsetConfigurationName(String configurationName) Sets the caption that will be set to filter in opened screen.voidsetMetaProperty(MetaProperty metaProperty) Sets the MetaProperty from which you want to show related entities.voidsetOpenMode(OpenMode openMode) Sets the screen open mode.voidsetProperty(String property) Sets the property from which you want to show related entities.voidsetRelatedEntitiesApi(RelatedEntitiesSupport relatedEntitiesSupport) voidsetScreenClass(Class<? extends Screen> screenClass) Sets the screen class.voidsetScreenConfigurer(Consumer<Screen> screenConfigurer) Sets the screen configurer.voidsetScreenId(String screenId) Sets the screen id.voidsetScreenOptionsSupplier(Supplier<ScreenOptions> screenOptionsSupplier) Sets the screen options supplier.Methods inherited from class io.jmix.ui.action.list.SecuredListAction
getConstraintEntityOp, isApplicable, isPermitted, setAccessManager, setApplicationContext, setConstraintEntityOp, setMetadataMethods inherited from class io.jmix.ui.action.ListAction
getTarget, setTarget, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcutMethods inherited from class io.jmix.ui.action.BaseAction
addActionPerformedListener, addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternalMethods inherited from class io.jmix.ui.action.AbstractAction
addOwner, 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.ui.action.Action
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, refreshState, removeOwner, removePropertyChangeListener, setCaption, setDescription, setEnabled, setIcon, setShortcut, setShortcutCombination, setVisibleMethods inherited from interface io.jmix.ui.action.Action.AdjustWhenScreenReadOnly
isDisabledWhenScreenReadOnly
-
Field Details
-
ID
- See Also:
-
screenInitializer
-
metaProperty
-
property
-
configurationName
-
-
Constructor Details
-
RelatedAction
public RelatedAction() -
RelatedAction
-
-
Method Details
-
getOpenMode
Description copied from interface:Action.ScreenOpeningActionReturns the screen open mode if it was set byAction.ScreenOpeningAction.setOpenMode(OpenMode)or in the screen XML, otherwise returnsnull.- Specified by:
getOpenModein interfaceAction.ScreenOpeningAction
-
setOpenMode
Description copied from interface:Action.ScreenOpeningActionSets the screen open mode.- Specified by:
setOpenModein interfaceAction.ScreenOpeningAction- Parameters:
openMode- the open mode to set
-
getScreenId
Description copied from interface:Action.ScreenOpeningActionReturns the screen id if it was set byAction.ScreenOpeningAction.setScreenId(String)or in the screen XML, otherwise returnsnull.- Specified by:
getScreenIdin interfaceAction.ScreenOpeningAction
-
setScreenId
Description copied from interface:Action.ScreenOpeningActionSets the screen id.- Specified by:
setScreenIdin interfaceAction.ScreenOpeningAction- Parameters:
screenId- the screen id to set
-
getScreenClass
Description copied from interface:Action.ScreenOpeningActionReturns the screen class if it was set byAction.ScreenOpeningAction.setScreenClass(Class)or in the screen XML, otherwise returnsnull.- Specified by:
getScreenClassin interfaceAction.ScreenOpeningAction
-
setScreenClass
Description copied from interface:Action.ScreenOpeningActionSets the screen class.- Specified by:
setScreenClassin interfaceAction.ScreenOpeningAction- Parameters:
screenClass- the screen class to set
-
setScreenOptionsSupplier
Description copied from interface:Action.ScreenOpeningActionSets the screen options supplier. The supplier providesScreenOptionsto the opened screen.The preferred way to set the supplier is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "screenOptionsSupplier") protected ScreenOptions petsTableViewScreenOptionsSupplier() { return new MapScreenOptions(ParamsMap.of("someParameter", 10)); }- Specified by:
setScreenOptionsSupplierin interfaceAction.ScreenOpeningAction
-
setScreenConfigurer
Description copied from interface:Action.ScreenOpeningActionSets the screen configurer. Use the configurer if you need to provide parameters to the opened screen through setters.The preferred way to set the configurer is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "screenConfigurer") protected void petsTableViewScreenConfigurer(Screen editorScreen) { ((PetEdit) editorScreen).setSomeParameter(someValue); }- Specified by:
setScreenConfigurerin interfaceAction.ScreenOpeningAction
-
setAfterCloseHandler
Description copied from interface:Action.ScreenOpeningActionSets the handler to be invoked when the editor screen closes.The preferred way to set the handler is using a controller method annotated with
Install, e.g.:@Install(to = "petsTable.view", subject = "afterCloseHandler") protected void petsTableViewAfterCloseHandler(AfterCloseEvent event) { if (event.closedWith(StandardOutcome.COMMIT)) { System.out.println("Committed"); } }- Specified by:
setAfterCloseHandlerin interfaceAction.ScreenOpeningAction
-
getMetaProperty
- Returns:
- the MetaProperty from which you want to show related entities
-
setMetaProperty
Sets the MetaProperty from which you want to show related entities.- Parameters:
metaProperty- the MetaProperty to set
-
getProperty
- Returns:
- the property from which you want to show related entities
-
setProperty
Sets the property from which you want to show related entities.- Parameters:
property- the property to set
-
getConfigurationName
- Returns:
- the caption that will be set to filter in opened screen
-
setConfigurationName
Sets the caption that will be set to filter in opened screen.- Parameters:
configurationName- the caption to set
-
actionPerform
Description copied from interface:ActionInvoked by owning component to execute the action.- Specified by:
actionPerformin interfaceAction- Overrides:
actionPerformin classBaseAction- Parameters:
component- invoking component
-
execute
public void execute()Description copied from interface:Action.ExecutableActionExecutes theAction- Specified by:
executein interfaceAction.ExecutableAction