@Component(value="cuba_RemoveAction") @Scope(value="prototype") public class RemoveAction extends ItemTrackingAction implements Action.HasBeforeActionPerformedHandler
Action's behaviour can be customized by providing arguments to constructor, setting properties, or overriding
method afterRemove(java.util.Set)
)}
In order to provide your own implementation globally, create a subclass and register it in web-spring.xml
,
for example:
<bean id="cuba_RemoveAction" class="com.company.sample.gui.MyRemoveAction" scope="prototype"/>Also, use
create()
static methods instead of constructors when creating the action programmatically.Modifier and Type | Class and Description |
---|---|
static interface |
RemoveAction.AfterRemoveHandler |
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 |
---|
RemoveAction(ListComponent target)
The simplest constructor.
|
RemoveAction(ListComponent target,
boolean autocommit)
Constructor that allows to specify autocommit value.
|
RemoveAction(ListComponent target,
boolean autocommit,
java.lang.String id)
Constructor that allows to specify action's identifier and autocommit value.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerform(Component component)
This method is invoked by the action owner component.
|
static RemoveAction |
create(ListComponent target)
Creates an action with default id.
|
static RemoveAction |
create(ListComponent target,
boolean autocommit)
Creates an action with default id.
|
static RemoveAction |
create(ListComponent target,
boolean autocommit,
java.lang.String id)
Creates an action with the given id.
|
Action.BeforeActionPerformedHandler |
getBeforeActionPerformedHandler() |
java.lang.String |
getConfirmationMessage()
Provides confirmation dialog message.
|
java.lang.String |
getConfirmationTitle()
Provides confirmation dialog title.
|
boolean |
isAutocommit() |
boolean |
isConfirm() |
void |
setAfterRemoveHandler(RemoveAction.AfterRemoveHandler afterRemoveHandler) |
void |
setAutocommit(boolean autocommit) |
void |
setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler) |
void |
setConfirm(boolean confirm) |
void |
setConfirmationMessage(java.lang.String confirmationMessage) |
void |
setConfirmationTitle(java.lang.String confirmationTitle) |
getConstraintCode, getConstraintOperationType, setConstraintCode, setConstraintOperationType
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 RemoveAction(ListComponent target)
target
- component containing this actionpublic RemoveAction(ListComponent target, boolean autocommit)
target
- component containing this actionautocommit
- whether to commit datasource immediatelypublic RemoveAction(ListComponent target, boolean autocommit, java.lang.String id)
target
- component containing this actionautocommit
- whether to commit datasource immediatelyid
- action's identifierpublic static RemoveAction create(ListComponent target)
target
- component containing this actionpublic static RemoveAction create(ListComponent target, boolean autocommit)
target
- component containing this actionautocommit
- whether to commit datasource immediatelypublic static RemoveAction create(ListComponent target, boolean autocommit, java.lang.String id)
target
- component containing this actionautocommit
- whether to commit datasource immediatelyid
- action's identifierpublic void actionPerform(Component component)
actionPerform
in interface Action
actionPerform
in class BaseAction
component
- component invoking the actionpublic boolean isAutocommit()
public void setAutocommit(boolean autocommit)
autocommit
- whether to commit datasource immediately after deletionpublic boolean isConfirm()
public void setConfirm(boolean confirm)
confirm
- whether to show the confirmation dialog to userpublic java.lang.String getConfirmationMessage()
public void setConfirmationMessage(java.lang.String confirmationMessage)
confirmationMessage
- confirmation dialog messagepublic java.lang.String getConfirmationTitle()
public void setConfirmationTitle(java.lang.String confirmationTitle)
confirmationTitle
- confirmation dialog title.public void setAfterRemoveHandler(RemoveAction.AfterRemoveHandler afterRemoveHandler)
afterRemoveHandler
- handler that is invoked after removepublic Action.BeforeActionPerformedHandler getBeforeActionPerformedHandler()
getBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler
public void setBeforeActionPerformedHandler(Action.BeforeActionPerformedHandler handler)
setBeforeActionPerformedHandler
in interface Action.HasBeforeActionPerformedHandler