/** * Appends the contents of another {@link SafeStyles} object, without applying * any escaping or sanitization to it. * * @param styles the {@link SafeStyles} to append * @return a reference to this object */ public SafeStylesBuilder append(SafeStyles styles) { sb.append(styles.asString()); return this; }
/** * Compares this string to the specified object. */ @Override public boolean equals(Object obj) { if (!(obj instanceof SafeStyles)) { return false; } return css.equals(((SafeStyles) obj).asString()); }
.toSafeStyles().asString());
public StylesBuilder styleProperty(SafeStyles style) { assertCanAddStylePropertyImpl(); sb.append(style.asString()); return style(); }
public SafeHtml getSafeHtml(SafeUri url, int left, int top, int width, int height, boolean isDraggable) { SafeStylesBuilder builder = new SafeStylesBuilder(); builder.width(width, Unit.PX).height(height, Unit.PX).trustedNameAndValue("background", "url(" + url.asString() + ") " + "no-repeat " + (-left + "px ") + (-top + "px")); if (!isDraggable) { return getTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } else { return getDraggableTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } }
/** * Compares this string to the specified object. */ @Override public boolean equals(Object obj) { if (!(obj instanceof SafeStyles)) { return false; } return css.equals(((SafeStyles) obj).asString()); }
/** * Compares this string to the specified object. */ @Override public boolean equals(Object obj) { if (!(obj instanceof SafeStyles)) { return false; } return css.equals(((SafeStyles) obj).asString()); }
/** * Appends the contents of another {@link SafeStyles} object, without applying * any escaping or sanitization to it. * * @param styles the {@link SafeStyles} to append * @return a reference to this object */ public SafeStylesBuilder append(SafeStyles styles) { sb.append(styles.asString()); return this; }
/** * Appends the contents of another {@link SafeStyles} object, without applying * any escaping or sanitization to it. * * @param styles the {@link SafeStyles} to append * @return a reference to this object */ public SafeStylesBuilder append(SafeStyles styles) { sb.append(styles.asString()); return this; }
public StylesBuilder styleProperty(SafeStyles style) { assertCanAddStylePropertyImpl(); sb.append(style.asString()); return style(); }
public StylesBuilder styleProperty(SafeStyles style) { assertCanAddStylePropertyImpl(); sb.append(style.asString()); return style(); }
protected void renderInput(SafeHtmlBuilder shb, String value, SafeStyles inputStyles, FieldCell.FieldAppearanceOptions options) { StringBuilder sb = new StringBuilder(); sb.append("<input "); if (options.isDisabled()) { sb.append("disabled=true "); } if (options.getName() != null) { sb.append("name='").append(SafeHtmlUtils.htmlEscape(options.getName())).append("' "); } if (options.isReadonly() || !options.isEditable()) { sb.append("readonly "); } if (inputStyles != null) { sb.append("style='").append(inputStyles.asString()).append("' "); } sb.append("class='").append(RESOURCES.style().field()).append(" ").append(RESOURCES.style().text()); if (!options.isEditable()) { sb.append(" ").append(RESOURCES.style().noedit()); } sb.append("' "); sb.append("type='text' value='").append(SafeHtmlUtils.htmlEscape(value)).append("' "); sb.append("/>"); shb.append(SafeHtmlUtils.fromTrustedString(sb.toString())); }
public SafeHtml getSafeHtml(SafeUri url, int left, int top, int width, int height, boolean isDraggable) { SafeStylesBuilder builder = new SafeStylesBuilder(); builder.width(width, Unit.PX).height(height, Unit.PX).trustedNameAndValue("background", "url(" + url.asString() + ") " + "no-repeat " + (-left + "px ") + (-top + "px")); if (!isDraggable) { return getTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } else { return getDraggableTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } }
public SafeHtml getSafeHtml(SafeUri url, int left, int top, int width, int height, boolean isDraggable) { SafeStylesBuilder builder = new SafeStylesBuilder(); builder.width(width, Unit.PX).height(height, Unit.PX).trustedNameAndValue("background", "url(" + url.asString() + ") " + "no-repeat " + (-left + "px ") + (-top + "px")); if (!isDraggable) { return getTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } else { return getDraggableTemplate().image(clearImage, SafeStylesUtils.fromTrustedString(builder.toSafeStyles().asString())); } }