Static Public Member Functions | Protected Member Functions

cern.gp.actions.support.ContextAction Class Reference

Inheritance diagram for cern.gp.actions.support.ContextAction:
cern.gp.actions.support.NodeAction

List of all members.

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)

Detailed Description

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.

Author:
Vito Baggiolini
Version:
Revision:
1.2
Date:
2006/09/25 08:52:36

Member Function Documentation

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.

See also:
org.openide.util.actions.NodeAction.enable(Node[])

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.

Parameters:
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.

Parameters:
ctx the object containing the context
static Object cern.gp.actions.support.ContextAction.unsetContext (  )  [static]

Clear the context and return it.

Returns:
the context set. May be null

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties