E - type of entitypublic abstract class AbstractLookupAction<E> extends BaseAction implements Action.ScreenOpeningAction
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 Icons |
icons |
protected io.jmix.core.Messages |
messages |
protected ScreenBuilders |
screenBuilders |
protected ActionScreenInitializer |
screenInitializer |
protected java.util.function.Predicate<LookupScreen.ValidationContext<E>> |
selectValidator |
protected java.util.function.Function<java.util.Collection<E>,java.util.Collection<E>> |
transformation |
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visiblePROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE| Constructor and Description |
|---|
AbstractLookupAction(java.lang.String id) |
| Modifier and Type | Method and Description |
|---|---|
OpenMode |
getOpenMode()
Returns the lookup screen open mode if it was set by
setOpenMode(OpenMode) or in the screen XML. |
java.lang.Class<? extends Screen> |
getScreenClass()
Returns the lookup screen class if it was set by
setScreenClass(Class) or in the screen XML. |
java.lang.String |
getScreenId()
Returns the lookup screen id if it was set by
setScreenId(String) or in the screen XML. |
void |
setAfterCloseHandler(java.util.function.Consumer<Screen.AfterCloseEvent> afterCloseHandler)
Sets the handler to be invoked when the lookup screen closes.
|
protected void |
setIcons(Icons icons) |
protected void |
setMessages(io.jmix.core.Messages messages) |
void |
setOpenMode(OpenMode openMode)
Sets the lookup screen open mode.
|
void |
setScreenBuilders(ScreenBuilders screenBuilders) |
void |
setScreenClass(java.lang.Class<? extends Screen> screenClass)
Sets the lookup screen id.
|
void |
setScreenConfigurer(java.util.function.Consumer<Screen> screenConfigurer)
Sets the lookup screen configurer.
|
void |
setScreenId(java.lang.String screenId)
Sets the lookup screen id.
|
void |
setScreenOptionsSupplier(java.util.function.Supplier<ScreenOptions> screenOptionsSupplier)
Sets the lookup screen options supplier.
|
void |
setSelectValidator(java.util.function.Predicate<LookupScreen.ValidationContext<E>> selectValidator)
Sets the validator to be invoked when the user selects entities in the lookup screen.
|
void |
setTransformation(java.util.function.Function<java.util.Collection<E>,java.util.Collection<E>> transformation)
Sets the function to transform selected in the lookup screen entities.
|
actionPerform, addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcutaddOwner, 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, waitaddOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setShortcut, setShortcutCombinationprotected ScreenBuilders screenBuilders
protected Icons icons
protected io.jmix.core.Messages messages
protected ActionScreenInitializer screenInitializer
protected java.util.function.Predicate<LookupScreen.ValidationContext<E>> selectValidator
@Autowired public void setScreenBuilders(ScreenBuilders screenBuilders)
@Autowired protected void setIcons(Icons icons)
@Autowired protected void setMessages(io.jmix.core.Messages messages)
@Nullable public OpenMode getOpenMode()
setOpenMode(OpenMode) or in the screen XML.
Otherwise returns null.getOpenMode in interface Action.ScreenOpeningAction@StudioPropertiesItem public void setOpenMode(@Nullable OpenMode openMode)
setOpenMode in interface Action.ScreenOpeningActionopenMode - the open mode to set@Nullable public java.lang.String getScreenId()
setScreenId(String) or in the screen XML.
Otherwise returns null.getScreenId in interface Action.ScreenOpeningAction@StudioPropertiesItem public void setScreenId(@Nullable java.lang.String screenId)
setScreenId in interface Action.ScreenOpeningActionscreenId - the screen id to set@Nullable public java.lang.Class<? extends Screen> getScreenClass()
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)
setScreenClass in interface Action.ScreenOpeningActionscreenClass - the screen class to setpublic void setScreenOptionsSupplier(java.util.function.Supplier<ScreenOptions> screenOptionsSupplier)
ScreenOptions to the
opened screen.
The preferred way to set the supplier is using a controller method annotated with Install, e.g.:
@Install(to = "petField.lookup", subject = "screenOptionsSupplier")
protected ScreenOptions petFieldLookupScreenOptionsSupplier() {
return new MapScreenOptions(ParamsMap.of("someParameter", 10));
}
setScreenOptionsSupplier in interface Action.ScreenOpeningActionpublic void setScreenConfigurer(java.util.function.Consumer<Screen> screenConfigurer)
The preferred way to set the configurer is using a controller method annotated with Install, e.g.:
@Install(to = "petField.lookup", subject = "screenConfigurer")
protected void petFieldLookupScreenConfigurer(Screen lookupScreen) {
((PetBrowse) lookupScreen).setSomeParameter(someValue);
}
setScreenConfigurer in interface Action.ScreenOpeningActionpublic void setAfterCloseHandler(java.util.function.Consumer<Screen.AfterCloseEvent> afterCloseHandler)
The preferred way to set the handler is using a controller method annotated with Install, e.g.:
@Install(to = "petField.lookup", subject = "afterCloseHandler")
protected void petFieldLookupAfterCloseHandler(AfterCloseEvent event) {
CloseAction closeAction = event.getCloseAction();
System.out.println("Closed with " + closeAction);
}
setAfterCloseHandler in interface Action.ScreenOpeningActionpublic void setSelectValidator(java.util.function.Predicate<LookupScreen.ValidationContext<E>> selectValidator)
The preferred way to set the validator is using a controller method annotated with Install, e.g.:
@Install(to = "petField.lookup", subject = "selectValidator")
protected void petFieldLookupSelectValidator(LookupScreen.ValidationContext<Pet> context) {
return checkSelected(context.getSelectedItems());
}
public void setTransformation(java.util.function.Function<java.util.Collection<E>,java.util.Collection<E>> transformation)
The preferred way to set the function is using a controller method annotated with Install, e.g.:
@Install(to = "petField.lookup", subject = "transformation")
protected Collection<Pet> petFieldLookupTransformation(Collection<Pet> entities) {
return doTransform(entities);
}