Class ExpressionContext

java.lang.Object
org.eclipse.e4.core.commands.ExpressionContext
All Implemented Interfaces:
IEvaluationContext

public class ExpressionContext extends Object implements 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 Details

  • Constructor Details

    • ExpressionContext

      public ExpressionContext(IEclipseContext eclipseContext)
  • Method Details

    • getParent

      public IEvaluationContext getParent()
      Description copied from interface: IEvaluationContext
      Returns the parent context or null if this is the root of the evaluation context hierarchy.
      Specified by:
      getParent in interface IEvaluationContext
      Returns:
      the parent evaluation context or null
    • getRoot

      public IEvaluationContext getRoot()
      Description copied from interface: IEvaluationContext
      Returns the root evaluation context.
      Specified by:
      getRoot in interface IEvaluationContext
      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 to true and the actual test expression must have the attribute forcePluginActivation set to true as well.
      Specified by:
      setAllowPluginActivation in interface IEvaluationContext
      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 via IEvaluationContext.setAllowPluginActivation(boolean) the parent value is returned. If no parent is set false is returned.
      Specified by:
      getAllowPluginActivation in interface IEvaluationContext
      Returns:
      whether plug-in activation is supported or not
    • getDefaultVariable

      public Object getDefaultVariable()
      Description copied from interface: IEvaluationContext
      Returns the default variable.
      Specified by:
      getDefaultVariable in interface IEvaluationContext
      Returns:
      the default variable or null if no default variable is managed.
    • addVariable

      public void addVariable(String name, Object value)
      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 interface IEvaluationContext
      Parameters:
      name - the variable's name
      value - the variable's value
    • removeVariable

      public Object removeVariable(String name)
      Description copied from interface: IEvaluationContext
      Removes the variable managed under the given name from this evaluation context.
      Specified by:
      removeVariable in interface IEvaluationContext
      Parameters:
      name - the variable's name
      Returns:
      the currently stored value or null if the variable doesn't exist
    • getVariable

      public Object getVariable(String name)
      Description copied from interface: IEvaluationContext
      Returns the variable managed under the given name.
      Specified by:
      getVariable in interface IEvaluationContext
      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

      public Object resolveVariable(String name, Object[] args) throws CoreException
      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 the resolve expression.
      Specified by:
      resolveVariable in interface IEvaluationContext
      Parameters:
      name - the variable to resolve
      args - 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