public abstract class ItemAction extends Object implements HMCStatefulAction
| Constructor and Description |
|---|
ItemAction() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canChange(Item item)
Returns
true if the current user can modify the given item. |
protected boolean |
canRead(Item item)
Returns
true if the current user can read the given item. |
protected boolean |
canRemove(Item item)
Returns
true if the current user can remove the given item. |
AbstractActionDialogChip |
createDialogChip(Chip parent,
AbstractActionChip actionChip) |
String |
getConfirmationMessage()
This default implementation returns
null (It means the standard confirmation message will be used if
confirmation is on). |
protected ItemEditorContext |
getEditorContext(ActionEvent actionEvent) |
protected HMCContext |
getHMCContext(ActionEvent actionEvent) |
protected Item |
getItem(ActionEvent actionEvent)
Reads the item form the ActionEvent.
|
protected Map |
getNodeParams() |
boolean |
hasDialogChip(AbstractActionChip actionChip) |
void |
initialize(ItemActionNode node) |
boolean |
isActive(ActionEvent event) |
boolean |
isAutoSave()
Returns true if auto save is enabled.
|
boolean |
isVisible(ActionEvent actionEvent) |
boolean |
needConfirmation()
This default implementation returns
false. |
boolean |
needSaveBeforePerform()
The item will be saved before performing action if this option is set to
true. |
abstract ActionResult |
perform(ActionEvent actionEvent)
This action requires the Item in ActionEvent data.
|
void |
setAutoSave(boolean autoSave)
Enables auto saving, see
isAutoSave(). |
public final void initialize(ItemActionNode node)
protected Map getNodeParams()
protected HMCContext getHMCContext(ActionEvent actionEvent)
public abstract ActionResult perform(ActionEvent actionEvent) throws JaloBusinessException
perform in interface HMCActionactionEvent - JaloBusinessExceptionpublic boolean needConfirmation()
false. Overwrite this method if you want confirmation for this
action.needConfirmation in interface HMCActionpublic String getConfirmationMessage()
null (It means the standard confirmation message will be used if
confirmation is on). Overwrite this method if you want your own confirmation message for this action.getConfirmationMessage in interface HMCActionpublic boolean needSaveBeforePerform()
true. This default
implementation returns true.protected Item getItem(ActionEvent actionEvent)
actionEvent - protected ItemEditorContext getEditorContext(ActionEvent actionEvent)
protected boolean canRead(Item item)
true if the current user can read the given item.item - Item to check the read right fortrue if the current user can read the given item, false otherwiseprotected boolean canChange(Item item)
true if the current user can modify the given item.item - Item to check the modify right fortrue if the current user can modify the given item, false otherwiseprotected boolean canRemove(Item item)
true if the current user can remove the given item.item - Item to check the remove right fortrue if the current user can remove the given item, false otherwisepublic boolean isActive(ActionEvent event)
isActive in interface HMCStatefulActionpublic boolean isVisible(ActionEvent actionEvent)
isVisible in interface HMCStatefulActionpublic boolean isAutoSave()
public void setAutoSave(boolean autoSave)
isAutoSave().autoSave - true to enable auto saving, default is false.public boolean hasDialogChip(AbstractActionChip actionChip)
hasDialogChip in interface HMCActionpublic AbstractActionDialogChip createDialogChip(Chip parent, AbstractActionChip actionChip)
createDialogChip in interface HMCActionCopyright © 2017 SAP SE. All Rights Reserved.