use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project activityinfo by bedatadriven.
the class LabelWidgetContainer method syncWithModel.
public void syncWithModel() {
final SafeHtmlBuilder label = new SafeHtmlBuilder();
label.append(SafeHtmlUtils.fromString(Strings.nullToEmpty(formLabel.getLabel())));
String labelHtml = label.toSafeHtml().asString();
if (!formLabel.isVisible()) {
labelHtml = "<del>" + labelHtml + "</del>";
}
fieldPanel.getLabel().setHTML(labelHtml);
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project activityinfo by bedatadriven.
the class PeriodTabStrip method render.
private void render() {
SafeHtmlBuilder list = new SafeHtmlBuilder();
list.append(TEMPLATES.button(-tabCount, "<<"));
list.append(TEMPLATES.button(-1, "<"));
for (int i = 0; i < tabCount; ++i) {
Tab tab = cursor.get(i);
String cssClass = tab.equals(getValue()) ? "active" : "";
list.append(TEMPLATES.tab(tab.getId(), tab.getLabel(), cssClass));
}
list.append(TEMPLATES.button(+1, ">"));
list.append(TEMPLATES.button(+tabCount, ">>"));
getElement().setInnerSafeHtml(TEMPLATES.tabList(list.toSafeHtml()));
recalculateTabCount();
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project activityinfo by bedatadriven.
the class SiteHistoryTab method renderStatus.
private void renderStatus(String message) {
SafeHtmlBuilder html = new SafeHtmlBuilder();
appendItemSpan(html, message);
content.setHtml(html.toSafeHtml());
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project activityinfo by bedatadriven.
the class SiteHistoryTab method render.
private void render(SiteDTO site, List<RecordHistoryEntry> entries) {
SafeHtmlBuilder html = new SafeHtmlBuilder();
if (site.getDateCreated().before(HISTORY_AVAILABLE_FROM)) {
appendItemSpan(html, I18N.MESSAGES.siteHistoryDateCreated(site.getDateCreated()));
html.appendHtmlConstant("<br>");
html.appendEscaped(I18N.MESSAGES.siteHistoryAvailableFrom(HISTORY_AVAILABLE_FROM));
}
for (RecordHistoryEntry entry : entries) {
appendTo(entry, html);
}
content.setHtml(html.toSafeHtml());
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project activityinfo by bedatadriven.
the class ElementWidget method renderStaticHtml.
private void renderStaticHtml() {
String text = ((TextReportElement) model).getText();
SplitResult lines = RegExp.compile("\r?\n").split(Strings.nullToEmpty(text));
SafeHtmlBuilder html = new SafeHtmlBuilder();
for (int i = 0; i < lines.length(); i++) {
if (i > 0) {
html.appendHtmlConstant("<br>");
}
html.appendEscaped(lines.get(i));
}
updateHtml(html.toSafeHtml().asString());
}
Aggregations