use of com.google.gwt.safehtml.shared.SafeUri in project activityinfo by bedatadriven.
the class GalleryRenderer method render.
@Override
public void render(List<T> models, SafeHtmlBuilder html) {
html.appendHtmlConstant("<dl>");
for (T model : models) {
SafeUri iconPath = UriUtils.fromTrustedString(GWT.getModuleBaseURL() + this.iconPath + model.get("path"));
String name = model.get("name");
String description = model.get("description");
html.append(TEMPLATES.item(iconPath, name, description));
}
html.appendHtmlConstant("<div style=\"clear:left;\"></div>");
html.appendHtmlConstant("</dl>");
}
use of com.google.gwt.safehtml.shared.SafeUri in project ovirt-engine by oVirt.
the class BookmarkListGroupItem method getHrefFromSearchString.
private String getHrefFromSearchString(String searchString) {
String currentPageUrl = FrontendUrlUtils.getCurrentPageURL();
String fragment = getFragmentFromSearchString(searchString);
if (fragment != null) {
currentPageUrl += HASH + fragment;
SafeUri result = UriUtils.fromString(currentPageUrl);
return result.asString();
}
return HASH;
}
use of com.google.gwt.safehtml.shared.SafeUri in project blogwt by billy1380.
the class FooterPart method fillFooter.
public void fillFooter(Element elCopyright) {
PropertyController controller = PropertyController.get();
SafeUri url = controller.copyrightHolderUrl();
String urlAsString = url.asString();
if (urlAsString.contains(ApiHelper.HOST) || urlAsString.startsWith("#")) {
elCopyright.setInnerSafeHtml(FooterTemplates.FOOTER_TEMPLATES.copyrightNoticeInternal(url, controller.copyrightHolder(), years(controller), controller.title(), version(controller)));
} else {
elCopyright.setInnerSafeHtml(FooterTemplates.FOOTER_TEMPLATES.copyrightNotice(url, controller.copyrightHolder(), years(controller), controller.title(), Resources.RES.styles().externalLink(), version(controller)));
}
}
use of com.google.gwt.safehtml.shared.SafeUri in project blogwt by billy1380.
the class Processor method emitEmoji.
static void emitEmoji(final StringBuilder out, final String name, Decorator decorator) {
String enableEmoji = PropertyController.get().stringProperty(PropertyHelper.POST_ENABLE_EMOJI);
if (!PropertyHelper.NONE_VALUE.equals(enableEmoji) && Emoji.get() != null) {
SafeUri safeLink = Emoji.get().safeUri(name);
String link;
String comment;
if (safeLink != null && (link = safeLink.asString()).length() != 0) {
comment = name + " emoji";
out.append("<img class=\"" + Resources.RES.styles().emoji() + "\" src=\"");
MarkdownUtils.appendValue(out, link, 0, link.length());
out.append("\" alt=\"");
MarkdownUtils.appendValue(out, name, 0, name.length());
out.append('"');
if (comment != null) {
out.append(" title=\"");
MarkdownUtils.appendValue(out, comment, 0, comment.length());
out.append('"');
}
out.append(" />");
}
}
}
use of com.google.gwt.safehtml.shared.SafeUri in project kie-wb-common by kiegroup.
the class DiagramNavigatorItemImpl method show.
public void show(final DiagramRepresentation diagramRepresentation, final int widthInPx, final int heightInPx, final Command callback) {
this.callback = callback;
this.name = diagramRepresentation.getName();
view.setUUID(name);
view.setItemTitle(diagramRepresentation.getTitle());
// Set size before Uri/data as we cannot scale until the image is loaded and it's real size known
view.setItemPxSize(widthInPx, heightInPx);
// Set Uri/data. Image's LoadHandler will set size requested above after image is loaded from Uri/data
final String thumbData = diagramRepresentation.getThumbImageData();
if (isEmpty(thumbData)) {
final String defSetId = diagramRepresentation.getDefinitionSetId();
final SafeUri thumbUri = shapeManager.getThumbnail(defSetId);
view.setThumbUri(thumbUri);
} else {
view.setThumbData(thumbData);
}
}
Aggregations