/** * Create and return a table body section builder. */ public static HtmlOnlyTableSectionBuilder createTBodyBuilder() { HtmlBuilderImpl htmlBuilderImpl = new HtmlBuilderImpl(); htmlBuilderImpl.startTBody(); return new HtmlOnlyTableSectionBuilder(htmlBuilderImpl); }
/** * Return the HTML as a {@link SafeHtml} string. */ public SafeHtml asSafeHtml() { return delegate.asSafeHtml(); }
/** * Add a trusted attribute without escaping the name. The value is still * escaped. */ public void trustedAttribute(String name, String value) { assertCanAddAttributeImpl(); sb.append(" ").append(name).append("=\"").append(escape(value)).append("\""); }
public HtmlInputBuilder startRadioInput(String name) { HtmlInputBuilder builder = startInput("radio"); attribute("name", name); return builder; }
/** * Start an input with the specified type. */ private HtmlInputBuilder startInput(String type) { trustedStart("input", inputBuilder); attribute("type", type); return inputBuilder; }
public void attribute(String name, int value) { trustedAttribute(escape(name), value); }
public StylesBuilder styleProperty(SafeStyles style) { assertCanAddStylePropertyImpl(); sb.append(style.asString()); return style(); }
/** * Create and return a table header section builder. */ public static HtmlOnlyTableSectionBuilder createTHeadBuilder() { HtmlBuilderImpl htmlBuilderImpl = new HtmlBuilderImpl(); htmlBuilderImpl.startTHead(); return new HtmlOnlyTableSectionBuilder(htmlBuilderImpl); }
/** * Create and return a table footer section builder. */ public static HtmlOnlyTableSectionBuilder createTFootBuilder() { HtmlBuilderImpl htmlBuilderImpl = new HtmlBuilderImpl(); htmlBuilderImpl.startTFoot(); return new HtmlOnlyTableSectionBuilder(htmlBuilderImpl); }
@Override public R attribute(String name, int value) { delegate.attribute(name, value); return getReturnBuilder(); }
/** * Start a tag using the specified builder. The tagName is not checked or * escaped. */ private void trustedStart(String tagName, ElementBuilderBase<?> builder) { onStart(tagName, builder); sb.append("<").append(tagName); } }
/** * Add a trusted attribute without escaping the name. */ public void trustedAttribute(String name, int value) { assertCanAddAttributeImpl(); sb.append(" ").append(name).append("=\"").append(value).append("\""); }
/** * Append html to the builder and validate the correctness of the html. * * @param html the html for the table section */ @Override public TableSectionBuilder html(SafeHtml html) { delegate.html(html); return getReturnBuilder(); } }
/** * Return the HTML as a {@link SafeHtml} string. */ public SafeHtml asSafeHtml() { // End all open tags. endAllTags(); /* * sb is trusted because we only append trusted strings or escaped strings * to it. */ return SafeHtmlUtils.fromTrustedString(sb.toString()); }
private HtmlBuilderImpl impl() { return new HtmlBuilderImpl(); } }
@Override public void endStyle() { delegate.endStyle(); }
@Override protected void doTextImpl(String text) { sb.append(escape(text)); }
public void attribute(String name, String value) { trustedAttribute(escape(name), value); }
public HtmlInputBuilder startRadioInput(String name) { HtmlInputBuilder builder = startInput("radio"); attribute("name", name); return builder; }
public StylesBuilder styleProperty(SafeStyles style) { assertCanAddStylePropertyImpl(); sb.append(style.asString()); return style(); }