Package com.google.gwt.user.rebind

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


      TemplateModel m = p.parse(template);
      SafeHtmlTemplatesCreator safeHtml = new SafeHtmlTemplatesCreator(context, l.branch(Type.DEBUG,
          "Building SafeHtmlTemplates"), method);

      sw.println(method.getReadableDeclaration(false, true, true, false, true) + "{");
      sw.indent();

      Map<String, JType> params = new HashMap<String, JType>();
      for (JParameter param : method.getParameters()) {
        params.put(param.getName(), param.getType());
      }
View Full Code Here


      SourceWriter sw=cf.createSourceWriter(context, pw);
     
      logger.log(Type.INFO, "Start generating assets bundle...");
      sw.println("@Override");
      sw.println("public ResourcePrototype[] getResources() {");
      sw.indent();
      sw.print("return MyClientBundleWithLookup.INSTANCE.getResources();");
      sw.outdent();
      sw.println("}");
     
      sw.println("static interface MyClientBundleWithLookup extends ClientBundleWithLookup{");
View Full Code Here

      sw.print("return MyClientBundleWithLookup.INSTANCE.getResources();");
      sw.outdent();
      sw.println("}");
     
      sw.println("static interface MyClientBundleWithLookup extends ClientBundleWithLookup{");
      sw.indent();
      sw.println("MyClientBundleWithLookup INSTANCE=GWT.create(MyClientBundleWithLookup.class);");
     
      for(File file:files){
        String sourcePath=file.getPath().replace(baseDir.getPath()+"\\","").replace('\\', '/');
        Class<? extends ResourcePrototype> returnType=matchReturnType(file.getName());
View Full Code Here

    TypeOracle typeOracle = context.getGeneratorContext().getTypeOracle();
    SourceWriter sw = new StringSourceWriter();
    // Write the expression to create the subtype.
    sw.println("new " + method.getReturnType().getQualifiedSourceName()
        + "() {");
    sw.indent();

    JClassType cssResourceSubtype = method.getReturnType().isInterface();
    assert cssResourceSubtype != null;
    Map<String, Map<JMethod, String>> replacementsWithPrefix = new HashMap<String, Map<JMethod, String>>();
View Full Code Here

    // Methods defined by CssResource interface
    writeEnsureInjected(sw);
    writeGetName(method, sw);

    sw.println("public String getText() {");
    sw.indent();
    boolean strict = isStrict(logger, method);
    Map<JMethod, String> actualReplacements = new IdentityHashMap<JMethod, String>();
    String cssExpression = makeExpression(logger, context, cssResourceSubtype,
        stylesheetMap.get(method), replacementsWithPrefix, strict,
        actualReplacements);
View Full Code Here

      JMethod method) throws UnableToCompleteException {
    String name = method.getName();

    SourceWriter sw = new StringSourceWriter();
    sw.println("new " + ImageResourcePrototype.class.getName() + "(");
    sw.indent();
    sw.println('"' + name + "\",");

    ImageRect rect = shared.imageRectsByName.get(name);
    assert rect != null : "No ImageRect ever computed for " + name;
View Full Code Here

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

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

        sw.println("public BeanModelFactory getFactory(Class b) {");
        sw.indent();
        sw.println("String n = b.getName();");
        sw.println("if (m == null) {");
        sw.indentln("m = new FastMap<BeanModelFactory>();");
        sw.println("}");
        sw.println("if (m.get(n) == null) {");
View Full Code Here

        sw.println("String n = b.getName();");
        sw.println("if (m == null) {");
        sw.indentln("m = new FastMap<BeanModelFactory>();");
        sw.println("}");
        sw.println("if (m.get(n) == null) {");
        sw.indent();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < beans.size(); i++) {
          JClassType bean = beans.get(i);
          String name = createBean(bean, logger, context);
          String factory = createFactory(bean, name, logger, context);
View Full Code Here

      TemplateModel m = p.parse(template);
      SafeHtmlTemplatesCreator safeHtml = new SafeHtmlTemplatesCreator(context, l.branch(Type.DEBUG,
          "Building SafeHtmlTemplates"), method);

      sw.println(method.getReadableDeclaration(false, true, true, false, true) + "{");
      sw.indent();

      Map<String, JType> params = new HashMap<String, JType>();
      for (JParameter param : method.getParameters()) {
        params.put(param.getName(), param.getType());
      }
View Full Code Here

    sw.println("var ua = navigator.userAgent.toLowerCase();");
    simpleStatement(sw, "chrome", "chrome");
    simpleStatement(sw, "opera", "opera");

    sw.println("if (ua.indexOf('msie') != -1) {");
    sw.indent();
    // TODO ChromeFrame?
    simpleStatement(sw, "msie 6", "ie6");
    simpleStatement(sw, "msie 7", "ie7");
    simpleStatement(sw, "msie 8", "ie8");
    // else assume newest
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.