Package com.google.gwt.user.rebind

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


        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.print("public SerialMode getPushMode() {return SerialMode." + annotation.pushmode().name() + ";}");
        sourceWriter.commit(logger);
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

    composer.addImport(HandlerRegistration.class.getCanonicalName());
    composer.addImport(LinkedList.class.getCanonicalName());
    composer.addImport(List.class.getCanonicalName());

    PrintWriter printWriter = context.tryCreate(logger, packageName, simpleName);
    return (printWriter != null) ? composer.createSourceWriter(context, printWriter) : null;
  }

  private String getSimpleGeneratedClassName(JClassType eventBinderType) {
    return eventBinderType.getName().replace('.', '_') + "Impl";
  }
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("nativeInit();");
      sw.println("init((" + userPrefsType.getQualifiedSourceName()
          + ")GWT.create(" + userPrefsType.getQualifiedSourceName()
View Full Code Here

    if (out != null) {
      JClassType preferenceType = typeOracle.findType(Preference.class.getName().replace('$', '.'));
      assert preferenceType != null;

      // We really use a SourceWriter since it's convenient
      SourceWriter sw = f.createSourceWriter(context, out);

      for (JMethod m : sourceType.getOverridableMethods()) {
        JClassType extendsPreferenceType = m.getReturnType().isClassOrInterface();
        if (extendsPreferenceType == null
            || !preferenceType.isAssignableFrom(extendsPreferenceType)) {
View Full Code Here

      composerFactory.addImplementedInterface(interfaceName);
    }

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

    // If an implementation already exists, we don't need to do any work
    if (out != null) {

      // We really use a SourceWriter since it's convenient
      final SourceWriter sw = f.createSourceWriter(context, out);

      JMethod[] methods = sourceType.getMethods();

      Map<Class<? extends ResourceGenerator>, List<JMethod>> resourceGenerators = new HashMap<Class<? extends ResourceGenerator>, List<JMethod>>();
View Full Code Here

        sourceType.getPackage().getName(), generatedSimpleSourceName);

    // If an implementation already exists, we don't need to do any work
    if (out != null) {
      // We really use a SourceWriter since it's convenient
      final SourceWriter sw = f.createSourceWriter(context, out);

      final Map<String, Task> propertyAccessors = TaskFactory.extractMethods(
          logger, typeOracle, sourceType, getPolicy());

      // Create the base context to be used during generation
View Full Code Here

                composerFactory.addImport(Serializer.class.getName());
                composerFactory.addImport(SerializationException.class.getName());
                composerFactory.addImport(Serializable.class.getName());

                composerFactory.setSuperclass(typeName);
                SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
                sourceWriter.print("private Serializer SERIALIZER = new " + realize + "();");
                sourceWriter.print("protected Serializer getRPCSerializer() {return SERIALIZER;}");
                sourceWriter.commit(logger);

            } catch (NotFoundException e) {
View Full Code Here

        // init composer, set class properties, create source writer
        ClassSourceFileComposerFactory composer = null;
        composer = new ClassSourceFileComposerFactory(packageName, className);
        composer.addImport("com.google.gwt.core.client.GWT");
        composer.setSuperclass("com.vaadin.client.ui.dd.VAcceptCriterionFactory");
        SourceWriter sourceWriter = composer.createSourceWriter(context,
                printWriter);

        // generator constructor source code
        generateInstantiatorMethod(sourceWriter, context, logger);
        // close generated class
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.