@Component(value="cuba_AddAction") @Scope(value="prototype") public class AddAction extends BaseAction implements Action.HasOpenType, Action.HasBeforeActionPerformedHandler
Action's behaviour can be customized by providing arguments to constructor or setting properties.
In order to provide your own implementation globally, create a subclass and register it in web-spring.xml
,
for example:
<bean id="cuba_AddAction" class="com.company.sample.gui.MyAddAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.Modifier and Type | Class and Description |
---|---|
static interface |
AddAction.AfterAddHandler |
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 |
---|
AddAction(ListComponent target)
The simplest constructor.
|
AddAction(ListComponent target,
Window.Lookup.Handler handler)
The simplest constructor.
|
AddAction(ListComponent target,
Window.Lookup.Handler handler,
WindowManager.OpenType openType)
Constructor that allows to specify how the lookup screen opens.
|
AddAction(ListComponent target,
Window.Lookup.Handler handler,
WindowManager.OpenType openType,
java.lang.String id)
Constructor that allows to specify the action name and how the lookup screen opens.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
This method is invoked by action owner component.
|
static AddAction |
create(ListComponent target)
Creates an action with default id, opening the lookup screen in THIS tab.
|
static AddAction |
create(ListComponent target,
Window.Lookup.Handler handler)
Creates an action with default id, opening the lookup screen in THIS tab.
|
static AddAction |
create(ListComponent target,
Window.Lookup.Handler handler,
WindowManager.OpenType openType)
Creates an action with default id, opening the lookup screen in THIS tab.
|
static AddAction |
create(ListComponent target,
Window.Lookup.Handler handler,
WindowManager.OpenType openType,
java.lang.String id)
Creates an action with the given id.
|
AddAction.AfterAddHandler |
getAfterAddHandler() |
Action.BeforeActionPerformedHandler |
getBeforeActionPerformedHandler() |
Window.Lookup.Handler |
getHandler() |
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 |
setAfterAddHandler(AddAction.AfterAddHandler afterAddHandler) |
void |
setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler) |
void |
setHandler(Window.Lookup.Handler handler) |
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) |
addEnabledRule, getTarget, isEnabledByUiPermissions, isVisibleByUiPermissions, refreshState, removeEnabledRule, setEnabled, setEnabledByUiPermissions, setTarget, setVisible, setVisibleByUiPermissions, withCaption, withDescription, withHandler, withIcon, withPrimary, withShortcut
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isPrimary, isVisible, removeOwner, removePropertyChangeListener, setCaption, setDescription, setIcon, setIconFromSet, setPrimary, setShortcut, setShortcutCombination
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addOwner, addPropertyChangeListener, getCaption, getDescription, getIcon, getId, getOwner, getOwners, getShortcutCombination, isEnabled, isVisible, refreshState, removeOwner, removePropertyChangeListener, setCaption, setDescription, setEnabled, setIcon, setIconFromSet, setShortcut, setShortcutCombination, setVisible
public AddAction(ListComponent target)
setHandler(com.haulmont.cuba.gui.components.Window.Lookup.Handler)
.
If it is not set, an instance of DefaultHandler
will be used.target
- component containing this actionpublic AddAction(ListComponent target, @Nullable Window.Lookup.Handler handler)
target
- component containing this actionhandler
- lookup handler. If null, an instance of DefaultHandler
will be used.public AddAction(ListComponent target, @Nullable Window.Lookup.Handler handler, WindowManager.OpenType openType)
target
- component containing this actionhandler
- lookup handler. If null, an instance of DefaultHandler
will be used.openType
- how to open the editor screenpublic AddAction(ListComponent target, @Nullable Window.Lookup.Handler handler, WindowManager.OpenType openType, java.lang.String id)
target
- component containing this actionhandler
- lookup handler. If null, an instance of DefaultHandler
will be used.openType
- how to open the editor screenid
- action's namepublic static AddAction create(ListComponent target)
target
- component containing this actionpublic static AddAction create(ListComponent target, @Nullable Window.Lookup.Handler handler)
target
- component containing this actionhandler
- lookup handler. If null, an instance of DefaultHandler
will be used.public static AddAction create(ListComponent target, @Nullable Window.Lookup.Handler handler, WindowManager.OpenType openType)
target
- component containing this actionhandler
- lookup handler. If null, an instance of DefaultHandler
will be used.openType
- how to open the editor screenpublic static AddAction create(ListComponent target, @Nullable Window.Lookup.Handler handler, WindowManager.OpenType openType, java.lang.String id)
target
- component containing this actionhandler
- lookup handler. If null, an instance of DefaultHandler
will be used.openType
- how to open the editor screenid
- action's namepublic AddAction.AfterAddHandler getAfterAddHandler()
public void setAfterAddHandler(AddAction.AfterAddHandler afterAddHandler)
public void actionPerform(Component component)
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- component invoking action@Nullable public Window.Lookup.Handler getHandler()
public void setHandler(Window.Lookup.Handler handler)
handler
- handler to pass to lookup screenpublic WindowManager.OpenType getOpenType()
getOpenType
in interface Action.HasOpenType
public void setOpenType(WindowManager.OpenType openType)
setOpenType
in interface Action.HasOpenType
openType
- lookup screen open typepublic java.lang.String getWindowId()
public void setWindowId(java.lang.String windowId)
windowId
- lookup screen idpublic java.util.Map<java.lang.String,java.lang.Object> getWindowParams()
public 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 lookup screen parameterspublic void setWindowParams(java.util.Map<java.lang.String,java.lang.Object> windowParams)
windowParams
- lookup screen parameterspublic Action.BeforeActionPerformedHandler getBeforeActionPerformedHandler()
getBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler
public void setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler)
setBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler