@Component(value="cuba_EditAction") @Scope(value="prototype") public class EditAction extends ItemTrackingAction implements Action.HasOpenType, Action.HasBeforeActionPerformedHandler
Action's behaviour can be customized by providing arguments to constructor, setting properties, or overriding
methods afterCommit(com.haulmont.cuba.core.entity.Entity)
, afterWindowClosed(com.haulmont.cuba.gui.components.Window)
In order to provide your own implementation globally, create a subclass and register it in web-spring.xml
,
for example:
<bean id="cuba_EditAction" class="com.company.sample.gui.MyEditAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.Modifier and Type | Class and Description |
---|---|
static interface |
EditAction.AfterCommitHandler |
static interface |
EditAction.AfterWindowClosedHandler |
static class |
EditAction.BulkEditorCloseEvent
Event that is fired when
BulkEditor windows gets closed. |
static class |
EditAction.BulkEditorIntegration
BulkEditor integration options.
|
BaseAction.EnabledRule
Action.ActionPerformedEvent, Action.BeforeActionPerformedHandler, Action.HasBeforeActionPerformedHandler, Action.HasOpenType, Action.HasSecurityConstraint, Action.HasTarget, Action.Status, Action.UiPermissionAware
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_ID |
PROP_CAPTION, PROP_DESCRIPTION, PROP_ENABLED, PROP_ICON, PROP_SHORTCUT, PROP_VISIBLE
Constructor and Description |
---|
EditAction(ListComponent target)
The simplest constructor.
|
EditAction(ListComponent target,
WindowManager.OpenType openType)
Constructor that allows to specify how the editor screen opens.
|
EditAction(ListComponent target,
WindowManager.OpenType openType,
java.lang.String id)
Constructor that allows to specify the action name and how the editor screen opens.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
This method is invoked by the action owner component.
|
static EditAction |
create(ListComponent target)
Creates an action with default id, opening the edit screen in THIS tab.
|
static EditAction |
create(ListComponent target,
WindowManager.OpenType openType)
Creates an action with default id.
|
static EditAction |
create(ListComponent target,
WindowManager.OpenType openType,
java.lang.String id)
Creates an action with the given id.
|
Action.BeforeActionPerformedHandler |
getBeforeActionPerformedHandler() |
EditAction.BulkEditorIntegration |
getBulkEditorIntegration() |
WindowManager.OpenType |
getOpenType() |
java.lang.String |
getWindowId() |
java.util.Map<java.lang.String,java.lang.Object> |
getWindowParams() |
java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> |
getWindowParamsSupplier() |
void |
refreshState()
Refresh internal state of the action to initialize enabled, visible, caption, icon, etc.
|
void |
setAfterCommitHandler(EditAction.AfterCommitHandler afterCommitHandler) |
void |
setAfterWindowClosedHandler(EditAction.AfterWindowClosedHandler afterWindowClosedHandler) |
void |
setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler) |
void |
setCaption(java.lang.String caption) |
void |
setEditorCloseListener(Window.CloseListener editorCloseListener)
Overwrites default close listener for editor window.
|
void |
setOpenType(WindowManager.OpenType openType) |
void |
setWindowId(java.lang.String windowId) |
void |
setWindowParams(java.util.Map<java.lang.String,java.lang.Object> windowParams) |
void |
setWindowParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> windowParamsSupplier) |
getConstraintCode, getConstraintOperationType, setConstraintCode, setConstraintOperationType
addEnabledRule, getTarget, isEnabledByUiPermissions, isVisibleByUiPermissions, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setTarget, setVisible, setVisibleByUiPermissions, withCaption, withDescription, withHandler, withIcon, withShortcut
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setDescription, setIcon, setPrimary, setShortcut, setShortcutCombination
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, removeOwner, removePropertyChangeListener, setDescription, setEnabled, setIcon, setShortcut, setShortcutCombination, setVisible
public EditAction(ListComponent target)
target
- component containing this actionpublic EditAction(ListComponent target, WindowManager.OpenType openType)
target
- component containing this actionopenType
- how to open the editor screenpublic EditAction(ListComponent target, WindowManager.OpenType openType, java.lang.String id)
target
- component containing this actionopenType
- how to open the editor screenid
- action namepublic static EditAction create(ListComponent target)
target
- component containing this actionpublic static EditAction create(ListComponent target, WindowManager.OpenType openType)
target
- component containing this actionopenType
- how to open the editor screenpublic static EditAction create(ListComponent target, WindowManager.OpenType openType, java.lang.String id)
target
- component containing this actionopenType
- how to open the editor screenid
- action namepublic void setCaption(java.lang.String caption)
setCaption
in interface Action
setCaption
in class AbstractAction
public void refreshState()
Action
refreshState
in interface Action
refreshState
in class BaseAction
public void actionPerform(Component component)
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- component invoking the actionpublic WindowManager.OpenType getOpenType()
getOpenType
in interface Action.HasOpenType
public void setOpenType(WindowManager.OpenType openType)
setOpenType
in interface Action.HasOpenType
openType
- editor screen open typepublic java.lang.String getWindowId()
public void setWindowId(java.lang.String windowId)
windowId
- editor screen identifierpublic java.util.Map<java.lang.String,java.lang.Object> getWindowParams()
public void setWindowParams(java.util.Map<java.lang.String,java.lang.Object> windowParams)
windowParams
- editor screen parameterspublic java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> getWindowParamsSupplier()
public void setWindowParamsSupplier(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> windowParamsSupplier)
windowParamsSupplier
- supplier that provides editor screen parameterspublic void setAfterCommitHandler(EditAction.AfterCommitHandler afterCommitHandler)
afterCommitHandler
- handler that is invoked after the editor was commited and closedpublic void setAfterWindowClosedHandler(EditAction.AfterWindowClosedHandler afterWindowClosedHandler)
afterWindowClosedHandler
- handler that is always invoked after the editor closedpublic void setEditorCloseListener(Window.CloseListener editorCloseListener)
editorCloseListener
- new close listenerpublic Action.BeforeActionPerformedHandler getBeforeActionPerformedHandler()
getBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler
public void setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler)
setBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler
public EditAction.BulkEditorIntegration getBulkEditorIntegration()