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));
}
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);
}
}
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);
}
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");
}
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());
}
Aggregations