Search in sources :

Example 36 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project ovirt-engine by oVirt.

the class TemplateBreadCrumbsView method getName.

@Override
public SafeHtml getName(VmTemplate item) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    builder.append(super.getName(item));
    if (!item.getId().equals(item.getBaseTemplateId())) {
        if (item.getTemplateVersionName() != null) {
            // $NON-NLS-1$
            builder.appendEscaped("/");
            builder.appendEscaped(item.getTemplateVersionName());
        }
        // $NON-NLS-1$
        builder.appendEscaped(" (");
        builder.append(item.getTemplateVersionNumber());
        // $NON-NLS-1$
        builder.appendEscaped(")");
    }
    return builder.toSafeHtml();
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 37 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project ovirt-engine by oVirt.

the class IconEditorWidget method toList.

private SafeHtml toList(List<String> stringItems) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    builder.appendEscaped(stringItems.get(0));
    return builder.toSafeHtml();
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 38 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project ovirt-engine by oVirt.

the class VmHighPerformanceConfigurationWidget method edit.

@Override
public void edit(VmHighPerformanceConfigurationModel object) {
    driver.edit(object);
    if (object.getRecommendationsList().size() > 0) {
        setVisibilityToRecommendationsListExpander(true);
        SafeHtmlBuilder recommendationsListBuilder = new SafeHtmlBuilder();
        for (String field : object.getRecommendationsList()) {
            // $NON-NLS-1$ //$NON-NLS-2$
            String escapedField = SafeHtmlUtils.htmlEscape(field).replaceAll("\n", "<br>");
            recommendationsListBuilder.append(bulletedItem(escapedField));
        }
        recommendationsList.setHTML(recommendationsListBuilder.toSafeHtml());
    }
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 39 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project ovirt-engine by oVirt.

the class HostNetworkInterfaceListViewItem method createLabelTooltipText.

private SafeHtml createLabelTooltipText(Set<String> labels) {
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    // $NON-NLS-1$
    builder.appendHtmlConstant(labels.stream().sorted().collect(Collectors.joining("<BR />")));
    return builder.toSafeHtml();
}
Also used : SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 40 with SafeHtmlBuilder

use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project closure-compiler by google.

the class DebuggerGwtMain method createCheckboxes.

private void createCheckboxes(CellPanel checkboxPanel) {
    for (CompilationParam.ParamGroup group : CompilationParam.ParamGroup.values()) {
        SafeHtmlBuilder builder = new SafeHtmlBuilder();
        builder.appendHtmlConstant("<b>");
        builder.appendEscaped(group.name);
        builder.appendHtmlConstant("</b>");
        checkboxPanel.add(new HTML(builder.toSafeHtml()));
        for (final CompilationParam param : CompilationParam.getGroupedSortedValues().get(group)) {
            CheckBox cb = new CheckBox(param.toString());
            if (param.getJavaInfo() != null) {
                cb.setTitle("Java API equivalent: " + param.getJavaInfo());
            }
            cb.setValue(param.getDefaultValue());
            param.apply(options, param.getDefaultValue());
            cb.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    boolean checked = ((CheckBox) event.getSource()).getValue();
                    param.apply(options, checked);
                    doCompile();
                }
            });
            checkboxPanel.add(cb);
        }
    }
}
Also used : CompilationParam(com.google.javascript.jscomp.debugger.common.CompilationParam) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) CheckBox(com.google.gwt.user.client.ui.CheckBox) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HTML(com.google.gwt.user.client.ui.HTML) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Aggregations

SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)142 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)26 Test (org.junit.Test)18 Column (com.google.gwt.user.cellview.client.Column)17 Cell (com.google.gwt.cell.client.Cell)14 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)12 Context (com.google.gwt.cell.client.Cell.Context)7 MenuItem (com.google.gwt.user.client.ui.MenuItem)7 NativeEvent (com.google.gwt.dom.client.NativeEvent)6 Command (com.google.gwt.user.client.Command)6 ArrayList (java.util.ArrayList)6 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)5 GWT (com.google.gwt.core.client.GWT)5 Element (com.google.gwt.dom.client.Element)5 AbstractCell (com.google.gwt.cell.client.AbstractCell)4 ClickableTextCell (com.google.gwt.cell.client.ClickableTextCell)4 TextCell (com.google.gwt.cell.client.TextCell)4 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)4 ImageResource (com.google.gwt.resources.client.ImageResource)4 Map (java.util.Map)4