Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.Expression.evaluate()


      IHandlerActivation activation) throws CoreException {
    Expression expression = activation.getExpression();
    if (expression == null) {
      return true;
    }
    return expression.evaluate(context) == EvaluationResult.TRUE;
  }

  /**
   * Normally the context returned from getCurrentState() still tracks the
   * application state. This method creates a copy and fills it in with the
View Full Code Here


    if (fExpressions == null)
      return EvaluationResult.TRUE;
    EvaluationResult result= EvaluationResult.TRUE;
    for (Iterator iter= fExpressions.iterator(); iter.hasNext();) {
      Expression expression= (Expression)iter.next();
      result= result.and(expression.evaluate(scope));
      // keep iterating even if we have a not loaded found. It can be
      // that we find a false which will result in a better result.
      if (result == EvaluationResult.FALSE)
        return result;
    }
View Full Code Here

    if (fExpressions == null)
      return EvaluationResult.TRUE;
    EvaluationResult result= EvaluationResult.FALSE;
    for (Iterator iter= fExpressions.iterator(); iter.hasNext();) {
      Expression expression= (Expression)iter.next();
      result= result.or(expression.evaluate(scope));
      if (result == EvaluationResult.TRUE)
        return result;
    }
    return result;
  }
View Full Code Here

    Expressions.checkAttribute(ATT_DEFINITION_ID, fDefinitionId.length() > 0 ? fDefinitionId : null);
  }

  public EvaluationResult evaluate(IEvaluationContext context) throws CoreException {
    Expression expr= getDefinitionRegistry().getExpression(fDefinitionId);
    return expr.evaluate(context);
  }

  public void collectExpressionInfo(ExpressionInfo info) {
    Expression expr;
    try {
View Full Code Here

      return EvaluationResult.TRUE;
    }
    EvaluationResult result = EvaluationResult.TRUE;
    for (Iterator iter = fExpressions.iterator(); iter.hasNext();) {
      Expression expression = (Expression) iter.next();
      result = result.and(expression.evaluate(scope));
      // keep iterating even if we have a not loaded found. It can be
      // that we find a false which will result in a better result.
      if (result == EvaluationResult.FALSE) {
        return result;
      }
View Full Code Here

      return EvaluationResult.TRUE;
    }
    EvaluationResult result = EvaluationResult.FALSE;
    for (Iterator iter = fExpressions.iterator(); iter.hasNext();) {
      Expression expression = (Expression) iter.next();
      result = result.or(expression.evaluate(scope));
      if (result == EvaluationResult.TRUE) {
        return result;
      }
    }
    return result;
View Full Code Here

    if (expr == null) {
      expr = createEnablementExpression(delegateShortcutID);
      expressions.put(delegateShortcutID, expr);
    }
    try {
      return expr.evaluate(createContext(receiver)) != EvaluationResult.FALSE;
    } catch (CoreException ce) {
      EclEmmaUIPlugin.log(ce);
      return false;
    }
  }
View Full Code Here

    if (expr == null) {
      expr = createEnablementExpression(delegateShortcutID);
      expressions.put(delegateShortcutID, expr);
    }
    try {
      return expr.evaluate(createContext(receiver)) != EvaluationResult.FALSE;
    } catch (CoreException ce) {
      EclEmmaUIPlugin.log(ce);
      return false;
    }
  }
View Full Code Here

   
    public boolean isEnabledFor(IConsole console) throws CoreException {
        EvaluationContext context = new EvaluationContext(null, console);
        Expression expression = getEnablementExpression();
        if (expression != null){
          EvaluationResult evaluationResult = expression.evaluate(context);
            return evaluationResult == EvaluationResult.TRUE; 
        }
        return true;
    }
   
View Full Code Here

            Expression enablementExpression = getEnablementExpression();
            if (enablementExpression == null) {
                return true;
            }
            EvaluationContext context = new EvaluationContext(null, this);
            EvaluationResult evaluationResult = enablementExpression.evaluate(context);
            return evaluationResult != EvaluationResult.FALSE;
        } catch (CoreException e) {
            ConsolePlugin.log(e);
            return false;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.