|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object users.AbstractCapability users.ActionCapability
public class ActionCapability
A special capability guarding an action object.
The ActionCapability is itself an Action again, so that you can write code like this:
public class S extends SalesPoint { ... public MenuSheet getDefaultMenuSheet() { MenuSheet ms = new MenuSheet(); ms.addItem ("Capability Test", (Action)getUser
().getCapability
("CapTest")); return ms; } ... }
Assuming that the CapTest capability is represented by an ActionCapability wrapping some other Action.
SalesPoint
,
MenuSheet
,
UserManager
,
User
,
Serialized FormConstructor Summary | |
---|---|
ActionCapability(String sName,
Action aToDo)
Create a granted capability. |
|
ActionCapability(String sName,
String sOnDeny,
Action aToDo,
boolean fGranted)
Create a new ActionCapability. |
Method Summary | |
---|---|
void |
doAction(SaleProcess p,
SalesPoint sp)
If the capability is granting rights, perform the guarded action; otherwise, print a message to the user that he/she is not granted the right to perform this action. |
Capability |
getToggled()
Get the ActionCapability that is the inverse to this one. |
boolean |
isGranted()
Return true if this capability is granting rights. |
Methods inherited from class users.AbstractCapability |
---|
getDisplayName, getDisplayName, getName, setDisplayNameResourceBundleName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ActionCapability(String sName, Action aToDo)
sName
- the name of the capability.aToDo
- the Action to be guarded.public ActionCapability(String sName, String sOnDeny, Action aToDo, boolean fGranted)
sName
- the name of the capability.sOnDeny
- a message to be popped up on denial.aToDo
- the Action to be guarded.fGranted
- true if this capability is to grant rights.Method Detail |
---|
public Capability getToggled()
getToggled
in interface Capability
getToggled
in class AbstractCapability
public boolean isGranted()
isGranted
in interface Capability
isGranted
in class AbstractCapability
public void doAction(SaleProcess p, SalesPoint sp) throws Throwable
doAction
in interface Action
p
- the process in which to perform the actionsp
- the SalesPoint on which to perform the action.
Throwable
- on any error that shall be reported and lead to cancellation of
the action.
|
SalesPoint v3.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |