Search in sources :

Example 81 with SafeHtml

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

the class AdvancedParametersExpander method initStyle.

private void initStyle() {
    SafeHtml expandImage = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(resources.expanderImage()).getHTML());
    expander.getUpFace().setHTML(templates.imageTextButton(expandImage, titleCollapsed));
    SafeHtml collapseImage = SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(resources.expanderDownImage()).getHTML());
    expander.getDownFace().setHTML(templates.imageTextButton(collapseImage, titleExpanded));
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml)

Example 82 with SafeHtml

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

the class AlertPanel method setMessages.

/**
 * Set a List of messages into the alert panel. Apply the same CSS class names to each message.
 * Note that this clears any existing messages.
 */
public void setMessages(List<SafeHtml> messages, String... styleNames) {
    clearMessages();
    for (SafeHtml message : messages) {
        HTMLPanel messageLabel = createMessageLabel(message);
        for (String s : styleNames) {
            messageLabel.addStyleName(s);
        }
        messagePanel.add(messageLabel);
    }
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel)

Example 83 with SafeHtml

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

the class AbstractCell method onBrowserEvent.

@Override
public void onBrowserEvent(Context context, Element parent, C value, NativeEvent event, ValueUpdater<C> valueUpdater) {
    SafeHtml tooltip = getTooltip(value);
    if (tooltip == null) {
        tooltip = getTooltip(value, parent, event);
    }
    ElementTooltipUtils.handleCellEvent(event, parent, tooltip);
    super.onBrowserEvent(context, parent, value, event, valueUpdater);
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml)

Example 84 with SafeHtml

use of com.google.gwt.safehtml.shared.SafeHtml in project kie-wb-common by kiegroup.

the class IssuePresenterTest method testShow.

@Test
public void testShow() throws Exception {
    Issue issue = new Issue(Severity.WARNING, CheckType.REDUNDANT_ROWS, new HashSet<>(Arrays.asList(3, 2, 1)));
    screen.show(issue);
    verify(view).setIssueTitle("RedundantRows");
    ArgumentCaptor<SafeHtml> safeHtmlArgumentCaptor = ArgumentCaptor.forClass(SafeHtml.class);
    verify(view).setExplanation(safeHtmlArgumentCaptor.capture());
    assertEquals("<p>MissingRangeP1(1)</p>", safeHtmlArgumentCaptor.getValue().asString());
    verify(view).setLines("1, 2, 3");
}
Also used : Issue(org.drools.verifier.api.reporting.Issue) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) Test(org.junit.Test)

Example 85 with SafeHtml

use of com.google.gwt.safehtml.shared.SafeHtml in project kie-wb-common by kiegroup.

the class PopupDropDownEditCellTest method testRender_LookupDropDownData.

@Test
public void testRender_LookupDropDownData() {
    final Cell.Context context = mock(Cell.Context.class);
    final SafeHtmlBuilder safeHtmlBuilder = mock(SafeHtmlBuilder.class);
    final String[] data = new String[] { "1=one", "2=two" };
    final DropDownData dd = DropDownData.create(data);
    when(dmo.getEnums(eq(FACT_TYPE), eq(FACT_FIELD), any(Map.class))).thenReturn(dd);
    when(listBox.getItemCount()).thenReturn(data.length);
    when(listBox.getValue(eq(0))).thenReturn("1");
    when(listBox.getValue(eq(1))).thenReturn("2");
    when(listBox.getItemText(eq(0))).thenReturn("one");
    when(listBox.getItemText(eq(1))).thenReturn("two");
    cell.render(context, "1", safeHtmlBuilder);
    final ArgumentCaptor<SafeHtml> captor = ArgumentCaptor.forClass(SafeHtml.class);
    verify(safeHtmlBuilder, times(1)).append(captor.capture());
    assertEquals("one", captor.getValue().asString());
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) Cell(com.google.gwt.cell.client.Cell) Map(java.util.Map) Test(org.junit.Test)

Aggregations

SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)129 Test (org.junit.Test)38 ImageResource (com.google.gwt.resources.client.ImageResource)25 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)25 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)11 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)9 ArrayList (java.util.ArrayList)8 Cell (com.google.gwt.cell.client.Cell)7 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)7 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 LinkedHashMap (java.util.LinkedHashMap)5 Map (java.util.Map)4 ConfirmCallback (org.eclipse.che.ide.api.dialogs.ConfirmCallback)4 ClickableTextCell (com.google.gwt.cell.client.ClickableTextCell)3 Element (com.google.gwt.dom.client.Element)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3