Package org.eclipse.core.expressions

Examples of org.eclipse.core.expressions.EvaluationResult


  public final boolean isEnabled(IEvaluationContext context) {
    final CommandLegacyActionWrapper action = getAction();
    if (enabledWhenExpression != null) {
      try {
        final EvaluationResult result = enabledWhenExpression
            .evaluate(context);
        if (result == EvaluationResult.TRUE) {
          updateDelegate(action, context);
          return (action == null)
              || action.isEnabledDisregardingCommand();
View Full Code Here


  }
 
  protected EvaluationResult evaluateAnd(IEvaluationContext scope) throws CoreException {
    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

  }
 
  protected EvaluationResult evaluateOr(IEvaluationContext scope) throws CoreException {
    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

 
  public EvaluationResult evaluate(IEvaluationContext context) throws CoreException {
    long start= 0;
    if (Expressions.TRACING)
      start= System.currentTimeMillis();
    EvaluationResult result= evaluateAnd(context);
    if (Expressions.TRACING) {
      System.out.println("[Enablement Expression] - evaluation time: " + //$NON-NLS-1$
        (System.currentTimeMillis() - start) + " ms."); //$NON-NLS-1$
    }
    return result;
View Full Code Here

          if (col instanceof List)
            return evaluateAnd(new DefaultVariable(context, ((List)col).get(0)));
          // fall through
        default:
          IteratePool iter= new IteratePool(context, col.iterator());
          EvaluationResult result= fOperator == AND ? EvaluationResult.TRUE : EvaluationResult.FALSE;
          while (iter.hasNext()) {
            iter.next();
            switch(fOperator) {
              case OR:
                result= result.or(evaluateAnd(iter));
                if (result == EvaluationResult.TRUE)
                  return result;
                break;
              case AND:
                result= result.and(evaluateAnd(iter));
                if (result != EvaluationResult.TRUE)
                  return result;
                break;
            }
          }
          return result;
      }
    } else {
      IIterable iterable= Expressions.getAsIIterable(var, this);
      if (iterable == null)
        return EvaluationResult.NOT_LOADED;
      int count= 0;
      IteratePool iter= new IteratePool(context, iterable.iterator());
      EvaluationResult result= fOperator == AND ? EvaluationResult.TRUE : EvaluationResult.FALSE;
      while (iter.hasNext()) {
        iter.next();
        count++;
        switch(fOperator) {
          case OR:
            result= result.or(evaluateAnd(iter));
            if (result == EvaluationResult.TRUE)
              return result;
            break;
          case AND:
            result= result.and(evaluateAnd(iter));
            if (result != EvaluationResult.TRUE)
              return result;
            break;
        }
      }
View Full Code Here

    return false;
  }

  public final EvaluationResult evaluate(final IEvaluationContext context)
      throws CoreException {
    final EvaluationResult result = super.evaluate(context);
    if (result == EvaluationResult.FALSE) {
      return result;
    }

    final Object variable = context
View Full Code Here

    return false;
  }

  public final EvaluationResult evaluate(final IEvaluationContext context)
      throws CoreException {
    final EvaluationResult result = super.evaluate(context);
    if (result == EvaluationResult.FALSE) {
      return result;
    }

    // Check the action sets.
View Full Code Here

    return false;
  }

  public final EvaluationResult evaluate(final IEvaluationContext context)
      throws CoreException {
    final EvaluationResult result = super.evaluate(context);
    if (result == EvaluationResult.FALSE) {
      return result;
    }

    final Object value = context.getVariable(ISources.ACTIVE_MENU_NAME);
View Full Code Here

    return false;
  }

  public final EvaluationResult evaluate(final IEvaluationContext context)
      throws CoreException {
    final EvaluationResult result = super.evaluate(context);
    if (result == EvaluationResult.FALSE) {
      return result;
    }

    final Object defaultVariable = context
View Full Code Here

  protected EvaluationResult evaluateAnd(IEvaluationContext scope)
      throws CoreException {
    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

TOP

Related Classes of org.eclipse.core.expressions.EvaluationResult

Copyright © 2018 www.massapicom. 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.