Package com.google.gwt.user.rebind

Examples of com.google.gwt.user.rebind.ClassSourceFileComposerFactory.createSourceWriter()


    composer.addImport(JSONString.class.getName());
    composer.addImport(JSONNumber.class.getName());
    composer.addImport(JSONBoolean.class.getName());
    composer.addImport(JSONObject.class.getName());

    SourceWriter sourceWriter = composer.createSourceWriter(context, printWriter);

    // generator constructor source code
    generateExtensions(context, logger, sourceWriter);
    // close generated class
    sourceWriter.outdent();
View Full Code Here


    ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory(packageName, simpleSourceName);
    factory.setSuperclass(typeName);
    factory.addImport(Name.getSourceNameForClass(GWT.class));

    SourceWriter sw = factory.createSourceWriter(context, pw);

    sw.println("public %1$s getStateBeanFactory() {", abf);
    sw.indentln("return GWT.create(%1$s.class);", abf);
    sw.println("}");
View Full Code Here

    }

    ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory(getPackageName(), getSimpleName());
    configureFactory(factory);

    SourceWriter sw = factory.createSourceWriter(getContext(), pw);
    create(sw);

    sw.commit(getLogger());
    return factory.getCreatedClassName();
  }
View Full Code Here

    // Loop through the formatters declared for this type and supertypes
    FormatCollector formatters = new FormatCollector(context, logger, toGenerate);
    MethodCollector invokables = new MethodCollector(context, logger, toGenerate);

    SourceWriter sw = factory.createSourceWriter(context, pw);

    for (JMethod method : toGenerate.getOverridableMethods()) {
      TreeLogger l = logger.branch(Type.DEBUG, "Creating XTemplate method " + method.getName());
      final String template;
      XTemplate marker = method.getAnnotation(XTemplate.class);
View Full Code Here

      return packageName + "." + simpleSourceName;
    }

    ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory(packageName, simpleSourceName);
    factory.addImplementedInterface(typeName);
    SourceWriter sw = factory.createSourceWriter(context, pw);

    for (JMethod method : toGenerate.getMethods()) {
      if (method.getReturnType().isPrimitive() != JPrimitiveType.BOOLEAN
          && !method.getReturnType().isClass().getQualifiedSourceName().equals(
              Name.getSourceNameForClass(Boolean.class))) {
View Full Code Here

        // Interfaces
        composerFactory.addImplementedInterface("org.jboss.as.console.client.ProductConfig");

        // SourceWriter
        SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);

        // fields
        generateFields(sourceWriter);

        // ctor
View Full Code Here

   
    cf.addImplementedInterface(userType.getQualifiedSourceName());
   
    PrintWriter pw=context.tryCreate(logger, packageName, implClassName);
    if(pw!=null){
      SourceWriter sw=cf.createSourceWriter(context, pw);
     
      logger.log(Type.INFO, "Start generating assets bundle...");
      sw.println("@Override");
      sw.println("public ResourcePrototype[] getResources() {");
      sw.indent();
View Full Code Here

      String qualName = packageName + "." + superClassName;
      ClassSourceFileComposerFactory factory = new ClassSourceFileComposerFactory(
          packageName, superClassName);
      factory.setSuperclass(targetClass.getQualifiedSourceName());
      factory.addImport("com.google.gwt.core.client.JavaScriptObject");
      SourceWriter writer = factory.createSourceWriter(context, pw);
      writer.println("private JavaScriptObject nativeDisplayNames;");
      writer.println();
      writer.println("@Override");
      writer.println("public String[] getAvailableLocaleNames() {");
      writer.println("  return new String[] {");
View Full Code Here

      factory.addImport("com.google.gwt.i18n.client.LocaleInfo");
      factory.addImport("com.google.gwt.i18n.client.constants.NumberConstants");
      factory.addImport("com.google.gwt.i18n.client.constants.NumberConstantsImpl");
      factory.addImport("com.google.gwt.i18n.client.constants.DateTimeConstants");
      factory.addImport("com.google.gwt.i18n.client.constants.DateTimeConstantsImpl");
      SourceWriter writer = factory.createSourceWriter(context, pw);
      writer.println("@Override");
      writer.println("public String getLocaleName() {");
      if (runtimeLocales.isEmpty()) {
        writer.println("  return \"" + locale + "\";");
      } else {
View Full Code Here

      // The whole point of this exercise
      f.addImplementedInterface(sourceType.getQualifiedSourceName());

      // All source gets written through this Writer
      SourceWriter sw = f.createSourceWriter(generatorContext, out);

      // Set the now-calculated simple source name
      resourceContext.setSimpleSourceName(generatedSimpleSourceName);

      // Write the generated code to disk
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.