Package com.google.gwt.user.rebind

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


    }

    composerFactory.setSuperclass(getProxySupertype().getSimpleName());
    composerFactory.addImplementedInterface(serviceAsync.getErasedType().getQualifiedSourceName());

    return composerFactory.createSourceWriter(ctx, printWriter);
  }
}
View Full Code Here


        composer = new ClassSourceFileComposerFactory(packageName, className);
        composer.addImport("com.google.gwt.core.client.GWT");
        composer.addImport("java.util.HashMap");
        composer.addImport("com.google.gwt.core.client.RunAsyncCallback");
        composer.setSuperclass("com.vaadin.terminal.gwt.client.WidgetMap");
        SourceWriter sourceWriter = composer.createSourceWriter(context,
                printWriter);

        Collection<Class<? extends Paintable>> paintablesHavingWidgetAnnotation = getUsedPaintables();

        validatePaintables(logger, context, paintablesHavingWidgetAnnotation);
View Full Code Here

        composerFactory.addImport(Serializer.class.getName());
        composerFactory.addImport(SerialMode.class.getName());
       
        composerFactory.setSuperclass(typeName);
        // TODO is the SERIALIZER required for DE RPC?
        SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
        sourceWriter.print("private Serializer SERIALIZER = new " + realize + "();");
        sourceWriter.print("protected Serializer getSerializer() {return SERIALIZER;}");
        sourceWriter.print("public SerialMode getMode() {return SerialMode." + annotation.mode().name() + ";}");
        sourceWriter.commit(logger);
       
View Full Code Here

      composer.addImport(FastMap.class.getName());

      PrintWriter pw = context.tryCreate(logger, genPackageName, genClassName);

      if (pw != null) {
        SourceWriter sw = composer.createSourceWriter(context, pw);

        sw.println("private Map<String, BeanModelFactory> m;");

        sw.println("public BeanModelFactory getFactory(Class b) {");
        sw.indent();
View Full Code Here

    ClassSourceFileComposerFactory composer = new ClassSourceFileComposerFactory(genPackageName, genClassName);
    composer.setSuperclass(BeanModelFactory.class.getCanonicalName());
    PrintWriter pw = context.tryCreate(logger, genPackageName, genClassName);

    if (pw != null) {
      SourceWriter sw = composer.createSourceWriter(context, pw);
      sw.println("public BeanModel newInstance() {");
      sw.println("return new " + beanModelName + "();");
      sw.println("}");
      sw.commit(logger);
    }
View Full Code Here

    PrintWriter pw = context.tryCreate(logger, genPackageName, genClassName);

    if (pw != null) {
      List<JMethod> getters = findGetters(bean);
      List<JMethod> setters = findSetters(bean);
      SourceWriter sw = composer.createSourceWriter(context, pw);

      sw.println("public " + genClassName + "(){");
      for (JMethod method : getters) {
        String s = method.getName();
        String p = lowerFirst(s.substring(s.startsWith("g") ? 3 : 2)); // get or
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.getMethods()) {
      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

    }

    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

    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

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.