Package org.noname.designer.core.interfaces

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


  }

  @Override
  protected IStatus run(IProgressMonitor monitor) {
    if (componentType != null) {
      EvaluationContext context = createContext();
      TypeDeclaration typeDec = getCompTypeDeclaration();
      if (typeDec != null) {
        MethodDeclaration constructor = getConstructor(typeDec);
        if (constructor != null) {
          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();
            }
View Full Code Here


    return Status.CANCEL_STATUS;
  }

  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

TOP

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

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.