@Component(value="cuba_LookupAction") @Scope(value="prototype") public static class PickerField.LookupAction extends PickerField.StandardAction
In order to provide your own implementation globally, create a subclass and register it in web-spring.xml
,
for example:
<bean id="cuba_LookupAction" class="com.company.sample.gui.MyLookupAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.BaseAction.EnabledRule
Action.ActionPerformedEvent, Action.BeforeActionPerformedHandler, Action.HasBeforeActionPerformedHandler, Action.HasOpenType, Action.HasSecurityConstraint, Action.HasTarget, Action.SecuredAction, Action.Status
Modifier and Type | Field and Description |
---|---|
protected PickerField.AfterLookupCloseHandler |
afterLookupCloseHandler |
protected PickerField.AfterLookupSelectionHandler |
afterLookupSelectionHandler |
protected java.lang.String |
lookupScreen |
protected WindowManager.OpenType |
lookupScreenOpenType |
protected java.util.Map<java.lang.String,java.lang.Object> |
lookupScreenParams |
protected java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
lookupScreenParamsSupplier |
static java.lang.String |
NAME |
protected WindowConfig |
windowConfig |
clientConfig, editable, pickerField
caption, description, enabled, eventHub, icon, id, owners, primary, shortcut, visible
PROP_EDITABLE
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE
Constructor and Description |
---|
LookupAction(PickerField pickerField) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
Invoked by owning component when an action occurs.
|
void |
afterCloseLookup(java.lang.String actionId)
Hook to be implemented in subclasses.
|
protected void |
afterLookupWindowOpened(Window lookupWindow) |
void |
afterSelect(java.util.Collection items)
Hook to be implemented in subclasses.
|
static PickerField.LookupAction |
create(PickerField pickerField) |
java.lang.String |
getLookupScreen() |
WindowManager.OpenType |
getLookupScreenOpenType() |
java.util.Map<java.lang.String,java.lang.Object> |
getLookupScreenParams() |
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
getLookupScreenParamsSupplier() |
protected void |
handleLookupWindowSelection(java.util.Collection items) |
protected java.util.Map<java.lang.String,java.lang.Object> |
prepareScreenParams() |
void |
setAfterLookupCloseHandler(PickerField.AfterLookupCloseHandler afterLookupCloseHandler) |
void |
setAfterLookupSelectionHandler(PickerField.AfterLookupSelectionHandler afterLookupSelectionHandler) |
void |
setLookupScreen(java.lang.String lookupScreen)
Set the lookup screen ID explicitly.
|
void |
setLookupScreenOpenType(WindowManager.OpenType lookupScreenOpenType)
How to open the lookup screen.
|
void |
setLookupScreenParams(java.util.Map<java.lang.String,java.lang.Object> lookupScreenParams)
Parameters to pass to the lookup screen.
|
void |
setLookupScreenParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> supplier) |
Entity |
transformValueFromLookupWindow(Entity valueFromLookupWindow)
Hook to be implemented in subclasses.
|
editableChanged, getPropertyDatasource, isEditable, setEditable, setPickerField
addActionPerformedListener, addEnabledRule, isApplicable, isEnabledByRule, isEnabledByUiPermissions, isPermitted, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setEnabledInternal, setVisible, setVisibleByUiPermissions, setVisibleInternal, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
addOwner, addPropertyChangeListener, firePropertyChange, getCaption, getDefaultCaption, getDescription, getEventHub, getIcon, getId, getOwner, getOwners, getShortcutCombination, hasSubscriptions, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setIconFromSet, setPrimary, setShortcut, setShortcutCombination
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setIconFromSet, setShortcut, setShortcutCombination
public static final java.lang.String NAME
protected java.lang.String lookupScreen
protected WindowManager.OpenType lookupScreenOpenType
protected java.util.Map<java.lang.String,java.lang.Object> lookupScreenParams
protected java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> lookupScreenParamsSupplier
protected PickerField.AfterLookupCloseHandler afterLookupCloseHandler
protected PickerField.AfterLookupSelectionHandler afterLookupSelectionHandler
protected WindowConfig windowConfig
public LookupAction(PickerField pickerField)
public static PickerField.LookupAction create(PickerField pickerField)
public void setAfterLookupCloseHandler(PickerField.AfterLookupCloseHandler afterLookupCloseHandler)
public void setAfterLookupSelectionHandler(PickerField.AfterLookupSelectionHandler afterLookupSelectionHandler)
public java.lang.String getLookupScreen()
public void setLookupScreen(@Nullable java.lang.String lookupScreen)
.lookup
to it.lookupScreen
- lookup screen ID, e.g. sec$User.lookup
public WindowManager.OpenType getLookupScreenOpenType()
public void setLookupScreenOpenType(WindowManager.OpenType lookupScreenOpenType)
WindowManager.OpenType.THIS_TAB
mode.lookupScreenOpenType
- open type@Nullable public java.util.Map<java.lang.String,java.lang.Object> getLookupScreenParams()
public void setLookupScreenParams(java.util.Map<java.lang.String,java.lang.Object> lookupScreenParams)
lookupScreenParams
- map of parameterspublic void actionPerform(Component component)
Action
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- invoking component@Nonnull protected java.util.Map<java.lang.String,java.lang.Object> prepareScreenParams()
protected void handleLookupWindowSelection(java.util.Collection items)
protected void afterLookupWindowOpened(Window lookupWindow)
public Entity transformValueFromLookupWindow(Entity valueFromLookupWindow)
valueFromLookupWindow
- value selected in Lookup window.public void afterSelect(java.util.Collection items)
items
- collection of entity instances selected by user, never nullpublic void afterCloseLookup(java.lang.String actionId)
actionId
- ID of action that closed the screen. The following values are possible:
public java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> getLookupScreenParamsSupplier()
public void setLookupScreenParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> supplier)