Example usage for com.google.gwt.safehtml.shared SafeHtmlUtils EMPTY_SAFE_HTML

List of usage examples for com.google.gwt.safehtml.shared SafeHtmlUtils EMPTY_SAFE_HTML

Introduction

In this page you can find the example usage for com.google.gwt.safehtml.shared SafeHtmlUtils EMPTY_SAFE_HTML.

Prototype

SafeHtml EMPTY_SAFE_HTML

To view the source code for com.google.gwt.safehtml.shared SafeHtmlUtils EMPTY_SAFE_HTML.

Click Source Link

Document

An empty String.

Usage

From source file:stroom.pipeline.structure.client.presenter.PipelineReferenceListPresenter.java

License:Apache License

private SafeHtml getSafeHtmlWithState(final PipelineReference pipelineReference, final String string) {
    if (string == null) {
        return SafeHtmlUtils.EMPTY_SAFE_HTML;
    }/*from  w w w. ja  v  a2 s.c  om*/

    final SafeHtmlBuilder builder = new SafeHtmlBuilder();
    final State state = referenceStateMap.get(pipelineReference);
    switch (state) {
    case ADDED:
        builder.append(ADDED);
        break;
    case REMOVED:
        builder.append(REMOVED);
        break;
    case INHERITED:
        builder.append(INHERITED);
        break;
    }

    builder.appendEscaped(string);
    builder.append(END);

    return builder.toSafeHtml();
}

From source file:stroom.pipeline.structure.client.presenter.PropertyListPresenter.java

License:Apache License

private SafeHtml getSafeHtmlWithState(final PipelineProperty property, final String string,
        final boolean showRemovedAsDefault) {
    if (string == null) {
        return SafeHtmlUtils.EMPTY_SAFE_HTML;
    }//from  w ww .j  ava  2s .  c o m

    final SafeHtmlBuilder builder = new SafeHtmlBuilder();
    if (pipelineModel.getPipelineData().getAddedProperties().contains(property)) {
        builder.append(ADDED);
    } else if (pipelineModel.getPipelineData().getRemovedProperties().contains(property)) {
        if (showRemovedAsDefault) {
            builder.append(DEFAULT);
        } else {
            builder.append(REMOVED);
        }
    } else {
        final PipelineProperty inheritedProperty = getInheritedProperty(property);
        if (inheritedProperty != null) {
            builder.append(INHERITED);
        } else {
            builder.append(DEFAULT);
        }
    }

    builder.appendEscaped(string);
    builder.append(END);

    return builder.toSafeHtml();
}

From source file:stroom.pipeline.structure.client.presenter.PropertyListPresenter.java

License:Apache License

private SafeHtml getSafeHtml(final String string) {
    if (string == null) {
        return SafeHtmlUtils.EMPTY_SAFE_HTML;
    }/*from w  ww. j  av  a  2 s . c o m*/

    return SafeHtmlUtils.fromString(string);
}

From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.MultiLineSafeHtmlRenderer.java

License:Apache License

public SafeHtml render(String object) {
    if (null == object) {
        return SafeHtmlUtils.EMPTY_SAFE_HTML;
    } else {//from w  w w.  j  av  a 2 s  .  c o m
        return SafeHtmlUtils
                .fromTrustedString(SafeHtmlUtils.htmlEscape(object).replaceAll("\\r\\n|[\\r\\n]", "<br>"));
    }
}