Search in sources :

Example 31 with SafeHtml

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

the class AlertPanel method updateBadge.

private void updateBadge() {
    badge.setVisible(count != 1);
    badgeText.setText(String.valueOf(count));
    if (badge.isVisible()) {
        SafeHtmlBuilder builder = new SafeHtmlBuilder();
        for (SafeHtml message : messagesList) {
            builder.append(message);
        }
        alertTooltip.setHtml(builder.toSafeHtml());
    }
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Example 32 with SafeHtml

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

the class AbstractImageCell method render.

@Override
public void render(Context context, T value, SafeHtmlBuilder sb, String id) {
    if (value != null) {
        final SafeHtml renderedImage = getRenderedImage(value);
        sb.append(template.imageContainerWithStyleClass(id, SafeStylesUtils.fromTrustedString(style), styleClass, renderedImage));
    }
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml)

Example 33 with SafeHtml

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

the class ColumnResizeCellTable method addColumnImpl.

private void addColumnImpl(Column<T, ?> column, Header<?> header) {
    // build resizable headers, if necessary
    if (columnResizingEnabled && header instanceof AbstractCheckboxHeader) {
        header = createResizableCheckboxHeader(header, column);
    } else if (columnResizingEnabled) {
        header = createResizableHeader(column, header);
    } else if (applyHeaderStyle && header instanceof SafeHtmlHeader) {
        SafeHtmlHeader safeHtmlHeader = (SafeHtmlHeader) header;
        // not using Resizeable header, but still want it to look that way.
        // nonResizeableColumnHeader does that.
        // TODO nonResizeableColumnHeader copy-pastes CSS. fix.
        SafeHtml newValue = templates.nonResizeableColumnHeader(safeHtmlHeader.getValue());
        header = new SafeHtmlHeader(newValue, safeHtmlHeader.getTooltip());
    }
    // actually add the column
    super.addColumn(column, header);
    // Add empty no-width column as the last column
    if (columnResizingEnabled) {
        if (isColumnPresent(emptyNoWidthColumn)) {
            removeColumn(emptyNoWidthColumn);
        }
        super.addColumn(emptyNoWidthColumn, emptyNoWidthColumnHeader);
    }
    // Add column to header context menu
    if (header instanceof AbstractHeader) {
        ((AbstractHeader) header).setContextMenuHandler(ensureContextMenuHandler());
        contextPopup.getContextMenu().addItem(column);
    }
}
Also used : SafeHtmlHeader(org.ovirt.engine.ui.common.widget.table.header.SafeHtmlHeader) AbstractHeader(org.ovirt.engine.ui.common.widget.table.header.AbstractHeader) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) AbstractCheckboxHeader(org.ovirt.engine.ui.common.widget.table.header.AbstractCheckboxHeader)

Example 34 with SafeHtml

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

the class ItemInfoPopup method generatePreviewSentence.

private String generatePreviewSentence() {
    SafeHtml host = templates.strongTextWithColor(constants.hostForOutOfSyncSentence(), SafeStylesUtils.forTrustedColor(WHITE_TEXT_COLOR));
    SafeHtml dc = templates.strongTextWithColor(constants.dcForOutOfSyncSentence(), SafeStylesUtils.forTrustedColor(WHITE_TEXT_COLOR));
    SafeHtml outOfSyncPreviewSentence = templates.coloredText(constants.hostOutOfSyncPreviewSentence(), SafeStylesUtils.forTrustedColor(TEXT_COLOR));
    return templates.hostOutOfSyncPreviewSentence(host, outOfSyncPreviewSentence, dc).asString();
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml)

Example 35 with SafeHtml

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

the class ItemInfoPopup method addSyncDiff.

/**
 * @param networkModel must be managed
 */
private void addSyncDiff(LogicalNetworkModel networkModel) {
    addRow(templates.imageTextSetupNetwork(notInSyncImage, templates.coloredText(constants.hostOutOfSync(), SafeStylesUtils.forTrustedColor(TEXT_COLOR))));
    SafeHtml safeHtml = SafeHtmlUtils.fromTrustedString(generatePreviewSentence());
    addRow(safeHtml);
    List<ReportedConfiguration> panelParameters = filterSyncProperties(networkModel);
    Widget networkOutOfSyncPanel = new NetworkOutOfSyncPanel(panelParameters).outOfSyncTableAsWidget();
    contents.insertRow(contents.getRowCount());
    contents.setWidget(contents.getRowCount(), 0, networkOutOfSyncPanel);
}
Also used : ReportedConfiguration(org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) Widget(com.google.gwt.user.client.ui.Widget)

Aggregations

SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)125 Test (org.junit.Test)34 ImageResource (com.google.gwt.resources.client.ImageResource)25 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)24 UpdateColumnAuditLogEntry (org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry)14 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)14 Column (com.google.gwt.user.cellview.client.Column)12 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)9 ArrayList (java.util.ArrayList)8 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)7 Cell (com.google.gwt.cell.client.Cell)6 HTML (com.google.gwt.user.client.ui.HTML)6 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)6 ConfirmDialog (org.eclipse.che.ide.api.dialogs.ConfirmDialog)6 TextColumn (com.google.gwt.user.cellview.client.TextColumn)5 LinkedHashMap (java.util.LinkedHashMap)5 Element (com.google.gwt.dom.client.Element)4 Map (java.util.Map)4 ConfirmCallback (org.eclipse.che.ide.api.dialogs.ConfirmCallback)4 ClickableTextCell (com.google.gwt.cell.client.ClickableTextCell)3