Package com.google.gwt.user.rebind

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


    writer.indent();
    writer.println(
        "((" +  ginjectorName + ") GWT.create(" + ginjectorName + ".class)).injectMembers(this);");
    writer.outdent();
    writer.println("}");
    writer.commit(logger);

    return packageName + "." + newClassName;
  }

  private String createGinjector(TreeLogger logger, GeneratorContext context, String packageName,
View Full Code Here


    ginjectorFactory.addImport(GinModules.class.getCanonicalName());
    ginjectorFactory.addAnnotationDeclaration("@GinModules(" + moduleName + ".class)");
    SourceWriter ginjectorWriter = ginjectorFactory.createSourceWriter(context,
        context.tryCreate(logger, packageName, ginjectorName));
    ginjectorWriter.println("void injectMembers(" + newClassName + " obj);");
    ginjectorWriter.commit(logger);
    return ginjectorName;
  }

  private String createModule(TreeLogger logger, GeneratorContext context, JClassType requestedType,
      String packageName, String requestedName) {
View Full Code Here

            + Math.pow(Integer.parseInt(name), 2) + "\");");
      }
    }
    moduleWriter.outdent();
    moduleWriter.println("}");
    moduleWriter.commit(logger);
    return moduleName;
  }
}
View Full Code Here

      generateGadgetManifest(logger, typeOracle, sourceType, new PrintWriter(
          new OutputStreamWriter(manifestOut)));
      context.commitResource(logger, manifestOut);

      sw.commit(logger);
    }

    return f.getCreatedClassName();
  }
View Full Code Here

                + ">");
        factory.addImplementedInterface(typeName);

        SourceWriter sw = factory.createSourceWriter(context, pw);
        writeGenerateAndSetIds(sw, parser.getOwnerType(), statements);
        sw.commit(logger);

        return factory.getCreatedClassName();
    }

    void writeGenerateAndSetIds(SourceWriter sw, JClassType ownerType,
View Full Code Here

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

    sw.commit(logger);

    return factory.getCreatedClassName();
  }

}
View Full Code Here

    configureFactory(factory);

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

    sw.commit(getLogger());
    return factory.getCreatedClassName();
  }

  public GeneratorContext getContext() {
    return context;
View Full Code Here

      safeHtml.create();
    }

    // Save the file and return its type name
    sw.commit(logger);
    return factory.getCreatedClassName();
  }

  protected InputStream getTemplateResource(GeneratorContext context, JClassType toGenerate, TreeLogger l,
      String markerPath) throws UnableToCompleteException {
View Full Code Here

      sw.indentln("return %1$b;", val.value().equals(value));

      sw.println("}");
    }

    sw.commit(logger);

    return factory.getCreatedClassName();
  }

}
View Full Code Here

      }
     
      sw.outdent();
      sw.println("}");
     
      sw.commit(logger);
      logger.log(Type.INFO, "Generated assets bundle successfully.");
    }
    return cf.getCreatedClassName();
  }
  private Class<? extends ResourcePrototype> matchReturnType(String filename) {
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.