Package com.google.gwt.user.rebind

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


        ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(
                packageName, className);
        composer.setSuperclass(requestedType);

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

        w.println("public void init() {");
        w.indent();

        for (ConnectorBundle bundle : bundles) {
View Full Code Here


        for (String interfaceName : interfaceNames) {
            composerFactory.addImplementedInterface(interfaceName);
        }

        composerFactory.addImport("org.timepedia.exporter.client.Exporter");
        return composerFactory.createSourceWriter(context, printWriter);
    }
}
View Full Code Here

    SourceWriter writer = null;

    try {
      composerFactory.addImplementedInterface(ReflectUtil.getSourceName(ginjectorInterface));

      writer = composerFactory.createSourceWriter(ctx, printWriter);

      String rootInjectorClass = ginjectorNameGenerator.getClassName(rootBindings);
      String rootFieldName = ginjectorNameGenerator.getFieldName(rootBindings);
      writer.beginJavaDocComment();
      writer.print("Top-level injector instance for injector " + rootBindings.getModule() + ".");
View Full Code Here

      return;
    }

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(packageName,
        implClassName);
    SourceWriter writer = composerFactory.createSourceWriter(ctx, printWriter);

    FragmentMap fragments = new FragmentMap(bindings, packageName, implClassName,
        fragmentOutputterFactory);

    outputBindings(bindings, fragments, writer);
View Full Code Here

    ClassSourceFileComposerFactory composerFactory = new ClassSourceFileComposerFactory(
        fragmentPackageName.toString(), fragmentClassName);

    composerFactory.addImport(GWT.class.getCanonicalName());
    composerFactory.addImport(ginjectorPackageName + "." + ginjectorClassName);
    writer = composerFactory.createSourceWriter(ctx, printWriter);

    injectorWriteContext = ginjectorFragmentContextFactory.create(bindings, fragmentPackageName,
        writer);
  }
View Full Code Here

    ClassSourceFileComposerFactory composerFactory =
        new ClassSourceFileComposerFactory(packageName, newClassName);
    composerFactory.setSuperclass(requestedType.getQualifiedSourceName());
    composerFactory.addImport(GWT.class.getCanonicalName());
    SourceWriter writer = composerFactory
        .createSourceWriter(context, context.tryCreate(logger, packageName, newClassName));
    writer.println("public void initialize() {");
    writer.indent();
    writer.println(
        "((" +  ginjectorName + ") GWT.create(" + ginjectorName + ".class)).injectMembers(this);");
View Full Code Here

        new ClassSourceFileComposerFactory(packageName, ginjectorName);
    ginjectorFactory.makeInterface();
    ginjectorFactory.addImplementedInterface(Ginjector.class.getCanonicalName());
    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;
  }
View Full Code Here

    String moduleName = requestedName + "Module";
    ClassSourceFileComposerFactory moduleFactory =
        new ClassSourceFileComposerFactory(packageName, moduleName);
    moduleFactory.setSuperclass(AbstractGinModule.class.getCanonicalName());
    moduleFactory.addImport(Names.class.getCanonicalName());
    SourceWriter moduleWriter = moduleFactory.createSourceWriter(context,
        context.tryCreate(logger, packageName, moduleName));

    moduleWriter.println("public void configure() {");
    moduleWriter.indent();
    for (JMethod method : requestedType.getMethods()) {
View Full Code Here

      JClassType userPrefsType = GadgetUtils.getUserPrefsType(logger,
          typeOracle, sourceType);

      // We really use a SourceWriter since it's convenient
      SourceWriter sw = f.createSourceWriter(context, out);
      sw.println("public " + generatedSimpleSourceName + "() {");
      sw.indent();
      sw.println("initializeFeatures();");
      sw.println("init((" + userPrefsType.getQualifiedSourceName()
          + ")GWT.create(" + userPrefsType.getQualifiedSourceName()
View Full Code Here

        factory.setSuperclass(superclass.getQualifiedSourceName() + "<"
                + parser.getOwnerType().getParameterizedQualifiedSourceName()
                + ">");
        factory.addImplementedInterface(typeName);

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

        return factory.getCreatedClassName();
    }
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.