Package org.noname.designer.core.interfaces

Examples of org.noname.designer.core.interfaces.FrameContext


          IEvaluator evaluator = (IEvaluator) Platform
              .getAdapterManager().getAdapter(constructor,
                  IEvaluator.class);
          if (evaluator != null) {
            int result = evaluator.evaluate(context);
            FrameContext consFrame = context.popup();
            if (result == IEvaluator.RETURN) {
              System.out.println("this="
                  + context.getThisObject());
              for (String fieldName : context.getFieldNames()) {
                System.out.println(fieldName + "="
                    + context.getField(fieldName));
              }
            } else if (result == IEvaluator.THROW) {
              Throwable throwable = (Throwable) consFrame.getResult();
              throwable.printStackTrace();
            }
            return Status.OK_STATUS;
          }
        }
View Full Code Here


  }

  private EvaluationContext createContext() {
    Object thisObj = createObject(componentType);
    EvaluationContext context = new EvaluationContext(thisObj);
    FrameContext frame = new FrameContext();
    context.push(frame);
    VariableContext arguments = new VariableContext();
    frame.push(arguments);
    return context;
  }
View Full Code Here

   * @return OK | THROW
   */
  @Override
  public int evaluate(EvaluationContext context) {
    Expression expression = invocation.getExpression();
    FrameContext frame = context.peek();
    VariableContext ctx = frame.peek();
    Stack<Object> stack = ctx.getStack();
    if (expression != null && !(expression instanceof ThisExpression)) {
      IEvaluator evaluator = (IEvaluator) Platform.getAdapterManager()
          .getAdapter(expression, IEvaluator.class);
      int result = evaluator.evaluate(context);
View Full Code Here

    return 0;
  }

  private int evaluateMethodInvocation(EvaluationContext context,
      MethodDeclaration mi) {
    FrameContext frame = new FrameContext();
    context.push(frame);
    VariableContext arguments = new VariableContext();
    frame.push(arguments);
    IEvaluator evaluator = (IEvaluator) Platform.getAdapterManager()
        .getAdapter(mi, IEvaluator.class);
    int ret = evaluator.evaluate(context);
    frame = context.popup();
    Object result = frame.getResult();
    switch (ret) {
    case THROW:
      context.peek().setResult(result);
      return THROW;
    case RETURN:
      return OK;
    }
    frame = context.peek();
    VariableContext varCtx = frame.peek();
    Stack<Object> stack = varCtx.getStack();
    stack.addElement(result);
    return OK;
  }
View Full Code Here

TOP

Related Classes of org.noname.designer.core.interfaces.FrameContext

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.