@Component(value="cuba_OpenAction") @Scope(value="prototype") public static class PickerField.OpenAction 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_OpenAction" class="com.company.sample.gui.MyOpenAction" 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 java.lang.String |
editScreen |
protected WindowManager.OpenType |
editScreenOpenType |
protected java.util.Map<java.lang.String,java.lang.Object> |
editScreenParams |
protected java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
editScreenParamsSupplier |
static java.lang.String |
NAME |
static java.lang.String |
READONLY |
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 |
---|
OpenAction(PickerField pickerField) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
Invoked by owning component when an action occurs.
|
protected void |
afterCommitOpenedEntity(Entity item) |
protected void |
afterWindowClosed(Window window)
Hook invoked after the editor was closed
|
static PickerField.OpenAction |
create(PickerField pickerField) |
protected java.lang.String |
getEditableIcon(java.lang.String icon,
boolean editable) |
java.lang.String |
getEditScreen() |
WindowManager.OpenType |
getEditScreenOpenType() |
java.util.Map<java.lang.String,java.lang.Object> |
getEditScreenParams() |
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
getEditScreenParamsSupplier() |
protected Entity |
getEntity() |
protected Entity |
initEntity() |
protected java.util.Map<java.lang.String,java.lang.Object> |
prepareScreenParams() |
void |
setEditable(boolean editable) |
void |
setEditScreen(java.lang.String editScreen)
Set the edit screen ID explicitly.
|
void |
setEditScreenOpenType(WindowManager.OpenType editScreenOpenType)
How to open the edit screen.
|
void |
setEditScreenParams(java.util.Map<java.lang.String,java.lang.Object> editScreenParams)
Parameters to pass to the edit screen.
|
void |
setEditScreenParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> editScreenParamsSupplier) |
editableChanged, getPropertyDatasource, isEditable, 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 editScreen
protected WindowManager.OpenType editScreenOpenType
protected java.util.Map<java.lang.String,java.lang.Object> editScreenParams
protected java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> editScreenParamsSupplier
protected WindowConfig windowConfig
public static final java.lang.String READONLY
public OpenAction(PickerField pickerField)
public static PickerField.OpenAction create(PickerField pickerField)
public java.lang.String getEditScreen()
public void setEditScreen(java.lang.String editScreen)
.edit
to it.editScreen
- edit screen ID, e.g. sec$User.edit
public WindowManager.OpenType getEditScreenOpenType()
public void setEditScreenOpenType(WindowManager.OpenType editScreenOpenType)
WindowManager.OpenType.THIS_TAB
mode.editScreenOpenType
- open type@Nullable public java.util.Map<java.lang.String,java.lang.Object> getEditScreenParams()
public void setEditScreenParams(java.util.Map<java.lang.String,java.lang.Object> editScreenParams)
editScreenParams
- map of parameterspublic java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> getEditScreenParamsSupplier()
public void setEditScreenParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> editScreenParamsSupplier)
public 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 Entity getEntity()
protected Entity initEntity()
protected void afterCommitOpenedEntity(Entity item)
protected void afterWindowClosed(Window window)
window
- the editor windowpublic void setEditable(boolean editable)
setEditable
in class PickerField.StandardAction
protected java.lang.String getEditableIcon(java.lang.String icon, boolean editable)