@StudioAction(target="io.jmix.ui.component.ListComponent", description="Opens a browser screen with list of related entities") @ActionType(value="related") public class RelatedAction extends SecuredListAction implements Action.AdjustWhenScreenReadOnly, Action.ScreenOpeningAction, Action.ExecutableAction
BaseAction.EnabledRuleAction.ActionPerformedEvent, Action.AdjustWhenScreenReadOnly, Action.ExecutableAction, Action.HasPrimaryState, Action.HasSecurityConstraint, Action.HasTarget, Action.MainTabSheetAction, Action.ScreenOpeningAction, Action.SecuredAction, Action.Status| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
configurationName |
static java.lang.String |
ID |
protected io.jmix.core.metamodel.model.MetaProperty |
metaProperty |
protected java.lang.String |
property |
protected RelatedEntitiesSupport |
relatedEntitiesSupport |
protected ActionScreenInitializer |
screenInitializer |
accessManager, constraintEntityOp, metadatatargetcaption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visiblePROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE| Constructor and Description |
|---|
RelatedAction() |
RelatedAction(java.lang.String id) |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerform(Component component)
Invoked by owning component to execute the action.
|
void |
execute()
Executes the
Action |
java.lang.String |
getConfigurationName() |
io.jmix.core.metamodel.model.MetaProperty |
getMetaProperty() |
OpenMode |
getOpenMode()
Returns the screen open mode if it was set by
Action.ScreenOpeningAction.setOpenMode(OpenMode)
or in the screen XML, otherwise returns null. |
java.lang.String |
getProperty() |
java.lang.Class<? extends Screen> |
getScreenClass()
Returns the screen class if it was set by
Action.ScreenOpeningAction.setScreenClass(Class)
or in the screen XML, otherwise returns null. |
java.lang.String |
getScreenId()
Returns the screen id if it was set by
Action.ScreenOpeningAction.setScreenId(String)
or in the screen XML, otherwise returns null. |
void |
setAfterCloseHandler(java.util.function.Consumer<Screen.AfterCloseEvent> afterCloseHandler)
Sets the handler to be invoked when the editor screen closes.
|
void |
setConfigurationName(java.lang.String configurationName)
Sets the caption that will be set to filter in opened screen.
|
void |
setMetaProperty(io.jmix.core.metamodel.model.MetaProperty metaProperty)
Sets the MetaProperty from which you want to show related entities.
|
void |
setOpenMode(OpenMode openMode)
Sets the screen open mode.
|
void |
setProperty(java.lang.String property)
Sets the property from which you want to show related entities.
|
void |
setRelatedEntitiesApi(RelatedEntitiesSupport relatedEntitiesSupport) |
void |
setScreenClass(java.lang.Class<? extends Screen> screenClass)
Sets the screen class.
|
void |
setScreenConfigurer(java.util.function.Consumer<Screen> screenConfigurer)
Sets the screen configurer.
|
void |
setScreenId(java.lang.String screenId)
Sets the screen id.
|
void |
setScreenOptionsSupplier(java.util.function.Supplier<ScreenOptions> screenOptionsSupplier)
Sets the screen options supplier.
|
getConstraintEntityOp, isApplicable, isPermitted, setAccessManager, setConstraintEntityOp, setMetadatagetTarget, setTarget, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcutaddActionPerformedListener, addEnabledRule, isEnabledByRule, isEnabledByUiPermissions, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternaladdOwner, addPropertyChangeListener, firePropertyChange, getCaption, getDescription, getEventHub, getIcon, getId, getOwner, getOwners, getShortcutCombination, hasSubscriptions, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setPrimary, setShortcut, setShortcutCombinationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisDisabledWhenScreenReadOnlyaddOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, refreshState, removeOwner, removePropertyChangeListener, setCaption, setDescription, setEnabled, setIcon, setShortcut, setShortcutCombination, setVisiblepublic static final java.lang.String ID
protected RelatedEntitiesSupport relatedEntitiesSupport
protected ActionScreenInitializer screenInitializer
protected io.jmix.core.metamodel.model.MetaProperty metaProperty
protected java.lang.String property
protected java.lang.String configurationName
public RelatedAction()
public RelatedAction(java.lang.String id)
@Autowired public void setRelatedEntitiesApi(RelatedEntitiesSupport relatedEntitiesSupport)
@Nullable public OpenMode getOpenMode()
Action.ScreenOpeningActionAction.ScreenOpeningAction.setOpenMode(OpenMode)
or in the screen XML, otherwise returns null.getOpenMode in interface Action.ScreenOpeningAction@StudioPropertiesItem public void setOpenMode(@Nullable OpenMode openMode)
Action.ScreenOpeningActionsetOpenMode in interface Action.ScreenOpeningActionopenMode - the open mode to set@Nullable public java.lang.String getScreenId()
Action.ScreenOpeningActionAction.ScreenOpeningAction.setScreenId(String)
or in the screen XML, otherwise returns null.getScreenId in interface Action.ScreenOpeningAction@StudioPropertiesItem public void setScreenId(@Nullable java.lang.String screenId)
Action.ScreenOpeningActionsetScreenId in interface Action.ScreenOpeningActionscreenId - the screen id to set@Nullable public java.lang.Class<? extends Screen> getScreenClass()
Action.ScreenOpeningActionAction.ScreenOpeningAction.setScreenClass(Class)
or in the screen XML, otherwise returns null.getScreenClass in interface Action.ScreenOpeningAction@StudioPropertiesItem public void setScreenClass(@Nullable java.lang.Class<? extends Screen> screenClass)
Action.ScreenOpeningActionsetScreenClass in interface Action.ScreenOpeningActionscreenClass - the screen class to setpublic void setScreenOptionsSupplier(java.util.function.Supplier<ScreenOptions> screenOptionsSupplier)
Action.ScreenOpeningActionScreenOptions to 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));
}
setScreenOptionsSupplier in interface Action.ScreenOpeningActionpublic void setScreenConfigurer(java.util.function.Consumer<Screen> screenConfigurer)
Action.ScreenOpeningAction
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);
}
setScreenConfigurer in interface Action.ScreenOpeningActionpublic void setAfterCloseHandler(java.util.function.Consumer<Screen.AfterCloseEvent> afterCloseHandler)
Action.ScreenOpeningAction
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");
}
}
setAfterCloseHandler in interface Action.ScreenOpeningAction@Nullable public io.jmix.core.metamodel.model.MetaProperty getMetaProperty()
public void setMetaProperty(@Nullable
io.jmix.core.metamodel.model.MetaProperty metaProperty)
metaProperty - the MetaProperty to set@Nullable public java.lang.String getProperty()
@StudioPropertiesItem public void setProperty(@Nullable java.lang.String property)
property - the property to set@Nullable public java.lang.String getConfigurationName()
@StudioPropertiesItem public void setConfigurationName(@Nullable java.lang.String configurationName)
configurationName - the caption to setpublic void actionPerform(Component component)
ActionactionPerform in interface ActionactionPerform in class BaseActioncomponent - invoking componentpublic void execute()
Action.ExecutableActionActionexecute in interface Action.ExecutableAction