Package com.google.gwt.user.rebind

Examples of com.google.gwt.user.rebind.SourceWriter.outdent()


      }
    }
    sw.outdent();
    sw.println("}");
    sw.println("return setJavaScriptObjectNative(obj);");
    sw.outdent();
    sw.println("}");

    // Method declaration
    sw.print("public native " + context.simpleTypeName
        + " setJavaScriptObjectNative(JavaScriptObject obj) /*-{");
 
View Full Code Here


      sw.print("delete ");
      sw.print(context.objRef);
      sw.print(".");
      sw.print(BACKREF);
      sw.println(";");
      sw.outdent();
      sw.println("}");
    }

    // If the incoming JSO is null or undefined, reset the JSWrapper
    sw.println("if (!obj) {");
View Full Code Here

    sw.println("if (!obj) {");
    sw.indent();
    sw.print(context.objRef);
    sw.println(" = null;");
    sw.println("return this;");
    sw.outdent();
    sw.println("}");

    if (context.maintainIdentity) {
      // Verify that the incoming object doesn't already have a wrapper object.
      // If there is a backreference, throw an exception.
View Full Code Here

      sw.print("if (obj.");
      sw.print(BACKREF);
      sw.println(") {");
      sw.indent();
      sw.println("@com.google.gwt.jsio.client.impl.JSONWrapperUtil::throwMultipleWrapperException()();");
      sw.outdent();
      sw.println("}");
    }

    // Capture the object in the wrapper
    sw.print(context.objRef);
View Full Code Here

      sw.print(context.objRef);
      sw.println(");");
    }

    sw.println("return this;");
    sw.outdent();
    sw.println("}-*/;");

    // If the generated class will be used with a JSList, we need an Extractor
    // implementation. We'll create an implementation per generated
    // class to ensure that if the class is used with a JSList, only one
View Full Code Here

        + "> getExtractor() {");
    sw.indent();
    sw.print("return ");
    sw.print(EXTRACTOR);
    sw.println(";");
    sw.outdent();
    sw.println("}");

    // The one instance of the Extractor
    sw.print("private final static Extractor ");
    sw.print(EXTRACTOR);
View Full Code Here

    sw.println("public native Object fromJS(JavaScriptObject obj) /*-{");
    sw.indent();
    sw.print("return ");
    fragmentGenerator.fromJS(subParams);
    sw.println(";");
    sw.outdent();
    sw.println("}-*/;");

    // Write the Extracor's toJS function and close the Extractor
    // implementation.
    sw.println("public native JavaScriptObject toJS(Object obj) /*-{");
 
View Full Code Here

    sw.println("public native JavaScriptObject toJS(Object obj) /*-{");
    sw.indent();
    sw.print("return ");
    fragmentGenerator.toJS(subParams);
    sw.println(";");
    sw.outdent();
    sw.println("}-*/;");

    // Finish the class
    sw.outdent();
    sw.println("};");
View Full Code Here

    sw.println(";");
    sw.outdent();
    sw.println("}-*/;");

    // Finish the class
    sw.outdent();
    sw.println("};");
  }

  protected void writeConstructor(FragmentGeneratorContext context,
      JMethod constructor) throws UnableToCompleteException {
View Full Code Here

    FragmentGeneratorContext subContext = new FragmentGeneratorContext(context);
    subContext.returnType = returnType;
    subContext.parameterName = "jsReturn";

    sw.println("return this.@com.google.gwt.jsio.client.JSWrapper::setJavaScriptObject(Lcom/google/gwt/core/client/JavaScriptObject;)(jsReturn);");
    sw.outdent();
    sw.println("}-*/;");
  }

  /**
   * Provides a method to encapsulate empty field initialization.
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.