Package org.eclipse.e4.core.commands
Class ExpressionContext
java.lang.Object
org.eclipse.e4.core.commands.ExpressionContext
- All Implemented Interfaces:
IEvaluationContext
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be referenced by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
Fields inherited from interface org.eclipse.core.expressions.IEvaluationContext
UNDEFINED_VARIABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVariable
(String name, Object value) Adds a new named variable to this context.boolean
Returns whether this evaluation context supports plug-in activation.Returns the default variable.Returns the parent context ornull
if this is the root of the evaluation context hierarchy.getRoot()
Returns the root evaluation context.getVariable
(String name) Returns the variable managed under the given name.removeVariable
(String name) Removes the variable managed under the given name from this evaluation context.resolveVariable
(String name, Object[] args) Resolves a variable for the given name and arguments.void
setAllowPluginActivation
(boolean value) Specifies whether this evaluation context allows activation of plug-ins for testers used in the expression tree.
-
Field Details
-
ALLOW_ACTIVATION
- See Also:
-
eclipseContext
-
defaultVariableConverter
-
-
Constructor Details
-
ExpressionContext
-
-
Method Details
-
getParent
Description copied from interface:IEvaluationContext
Returns the parent context ornull
if this is the root of the evaluation context hierarchy.- Specified by:
getParent
in interfaceIEvaluationContext
- Returns:
- the parent evaluation context or
null
-
getRoot
Description copied from interface:IEvaluationContext
Returns the root evaluation context.- Specified by:
getRoot
in interfaceIEvaluationContext
- Returns:
- the root evaluation context
-
setAllowPluginActivation
public void setAllowPluginActivation(boolean value) Description copied from interface:IEvaluationContext
Specifies whether this evaluation context allows activation of plug-ins for testers used in the expression tree. To actual trigger the plug-in loading this flag has to be set totrue
and the actual test expression must have the attributeforcePluginActivation
set totrue
as well.- Specified by:
setAllowPluginActivation
in interfaceIEvaluationContext
- Parameters:
value
- whether this evaluation context allows plug-in activation
-
getAllowPluginActivation
public boolean getAllowPluginActivation()Description copied from interface:IEvaluationContext
Returns whether this evaluation context supports plug-in activation. If not set viaIEvaluationContext.setAllowPluginActivation(boolean)
the parent value is returned. If no parent is setfalse
is returned.- Specified by:
getAllowPluginActivation
in interfaceIEvaluationContext
- Returns:
- whether plug-in activation is supported or not
-
getDefaultVariable
Description copied from interface:IEvaluationContext
Returns the default variable.- Specified by:
getDefaultVariable
in interfaceIEvaluationContext
- Returns:
- the default variable or
null
if no default variable is managed.
-
addVariable
Description copied from interface:IEvaluationContext
Adds a new named variable to this context. If a variable with the name already exists the new one overrides the existing one.- Specified by:
addVariable
in interfaceIEvaluationContext
- Parameters:
name
- the variable's namevalue
- the variable's value
-
removeVariable
Description copied from interface:IEvaluationContext
Removes the variable managed under the given name from this evaluation context.- Specified by:
removeVariable
in interfaceIEvaluationContext
- Parameters:
name
- the variable's name- Returns:
- the currently stored value or
null
if the variable doesn't exist
-
getVariable
Description copied from interface:IEvaluationContext
Returns the variable managed under the given name.- Specified by:
getVariable
in interfaceIEvaluationContext
- Parameters:
name
- the variable's name- Returns:
- the variable's value or
null
if the content doesn't manage a variable with the given name
-
resolveVariable
Description copied from interface:IEvaluationContext
Resolves a variable for the given name and arguments. This method can be used to dynamically resolve variable such as plug-in descriptors, resources, etc. The method is used by theresolve
expression.- Specified by:
resolveVariable
in interfaceIEvaluationContext
- Parameters:
name
- the variable to resolveargs
- an object array of arguments used to resolve the variable- Returns:
- the variable's value or
null
if no variable can be resolved for the given name and arguments - Throws:
CoreException
- may be thrown by overrides
-