Search in sources :

Example 1 with SafeUri

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>");
}
Also used : GWT(com.google.gwt.core.client.GWT) SafeUri(com.google.gwt.safehtml.shared.SafeUri)

Example 2 with SafeUri

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;
}
Also used : SafeUri(com.google.gwt.safehtml.shared.SafeUri)

Example 3 with SafeUri

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)));
    }
}
Also used : SafeUri(com.google.gwt.safehtml.shared.SafeUri) PropertyController(com.willshex.blogwt.client.controller.PropertyController)

Example 4 with SafeUri

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(" />");
        }
    }
}
Also used : SafeUri(com.google.gwt.safehtml.shared.SafeUri)

Example 5 with SafeUri

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);
    }
}
Also used : SafeUri(com.google.gwt.safehtml.shared.SafeUri)

Aggregations

SafeUri (com.google.gwt.safehtml.shared.SafeUri)12 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)2 GWT (com.google.gwt.core.client.GWT)1 AnchorElement (com.google.gwt.dom.client.AnchorElement)1 Element (com.google.gwt.dom.client.Element)1 ImageElement (com.google.gwt.dom.client.ImageElement)1 PropertyController (com.willshex.blogwt.client.controller.PropertyController)1 Page (com.willshex.blogwt.shared.api.datatype.Page)1 HashMap (java.util.HashMap)1 Test (org.junit.Test)1 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)1 ActivityShape (org.kie.workbench.common.stunner.cm.client.shape.ActivityShape)1 CaseManagementActivityShapeDef (org.kie.workbench.common.stunner.cm.client.shape.def.CaseManagementActivityShapeDef)1 ActivityView (org.kie.workbench.common.stunner.cm.client.shape.view.ActivityView)1 DiagramRepresentation (org.kie.workbench.common.stunner.core.lookup.diagram.DiagramRepresentation)1 PictureShapeView (org.kie.workbench.common.stunner.shapes.client.view.PictureShapeView)1 InOrder (org.mockito.InOrder)1