Static Public Member Functions | |
static void | setContext (Object ctx) |
static Object | unsetContext () |
Protected Member Functions | |
final void | performAction (GPNode[] activatedNodes) |
abstract void | performAction (GPNode[] activatedNodes, Object context) |
An action that contains a context in a static variable.
(The implementation uses a weak reference and to help you avoid memory leaks.) Please remember that GP (NetBeans) actions are singletons, and you are not supposed to instantiate them.
final void cern.gp.actions.support.ContextAction.performAction | ( | GPNode[] | activatedNodes | ) | [protected, virtual] |
the action will be enabled only if the super class enables it and if the context is not null.
protected boolean enable(Node[] nodes) { return super.enable(nodes) && (ref != null) && (ref.get() != null); }
Implements cern.gp.actions.support.NodeAction.
abstract void cern.gp.actions.support.ContextAction.performAction | ( | GPNode[] | activatedNodes, | |
Object | context | |||
) | [protected, pure virtual] |
A method called by GP when you invoke this action. You have to implement this method with the action you want to execute. Please note that the context parameter may be null.
activatedNodes | the nodes currently selected | |
context | the object set with setContext(Object) can be null |
static void cern.gp.actions.support.ContextAction.setContext | ( | Object | ctx | ) | [static] |
set a context object. Please remember that Actions are singletons, and therfore this context is shared by all places where this action is used.
ctx | the object containing the context |
static Object cern.gp.actions.support.ContextAction.unsetContext | ( | ) | [static] |
Clear the context and return it.