/** * Creates the template method invocation. * * @param w * * @return String the template method call with parameters */ public void writeTemplateCaller(IndentedWriter w) { ensureArgumentsResolved(); w.write("SafeHtml template_%s() {", methodName); w.indent(); w.write("return %s;", getDirectTemplateCall()); w.outdent(); w.write("}"); }
/** * Creates the template method invocation. * * @param w * * @return String the template method call with parameters */ public void writeTemplateCaller(IndentedWriter w) { ensureArgumentsResolved(); w.write("SafeHtml template_%s() {", methodName); w.indent(); w.write("return %s;", getDirectTemplateCall()); w.outdent(); w.write("}"); }
/** * Writes a new SafeHtml template to the generated BinderImpl. * * @return The invocation of the SafeHtml template function with the arguments * filled in */ public String declareTemplateCall(String html, String fieldName) throws IllegalArgumentException { if (!useSafeHtmlTemplates) { return '"' + html + '"'; } FieldWriter w = fieldManager.lookup(fieldName); HtmlTemplateMethodWriter templateMethod = htmlTemplates.addSafeHtmlTemplate(html, tokenator); if (useLazyWidgetBuilders) { w.setHtml(templateMethod.getIndirectTemplateCall()); } else { w.setHtml(templateMethod.getDirectTemplateCall()); } return w.getHtml(); }
/** * Writes a new SafeHtml template to the generated BinderImpl. * * @return The invocation of the SafeHtml template function with the arguments * filled in */ public String declareTemplateCall(String html, String fieldName) throws IllegalArgumentException { if (!useSafeHtmlTemplates) { return '"' + html + '"'; } FieldWriter w = fieldManager.lookup(fieldName); HtmlTemplateMethodWriter templateMethod = htmlTemplates.addSafeHtmlTemplate(html, tokenator); if (useLazyWidgetBuilders) { w.setHtml(templateMethod.getIndirectTemplateCall()); } else { w.setHtml(templateMethod.getDirectTemplateCall()); } return w.getHtml(); }
/** * Writes a new SafeHtml template to the generated BinderImpl. * * @return The invocation of the SafeHtml template function with the arguments * filled in */ public String declareTemplateCall(String html, String fieldName) throws IllegalArgumentException { if (!useSafeHtmlTemplates) { return '"' + html + '"'; } FieldWriter w = fieldManager.lookup(fieldName); HtmlTemplateMethodWriter templateMethod = htmlTemplates.addSafeHtmlTemplate(html, tokenator); if (useLazyWidgetBuilders) { w.setHtml(templateMethod.getIndirectTemplateCall()); } else { w.setHtml(templateMethod.getDirectTemplateCall()); } return w.getHtml(); }
/** * Writes a new SafeHtml template to the generated BinderImpl. * * @return The invocation of the SafeHtml template function with the arguments * filled in */ public String declareTemplateCall(String html, String fieldName) throws IllegalArgumentException { if (!useSafeHtmlTemplates) { return '"' + html + '"'; } FieldWriter w = fieldManager.lookup(fieldName); HtmlTemplateMethodWriter templateMethod = htmlTemplates.addSafeHtmlTemplate(html, tokenator); if (useLazyWidgetBuilders) { w.setHtml(templateMethod.getIndirectTemplateCall()); } else { w.setHtml(templateMethod.getDirectTemplateCall()); } return w.getHtml(); }