List of usage examples for com.vaadin.client WidgetUtil escapeHTML
public static String escapeHTML(String html)
From source file:com.haulmont.cuba.web.widgets.client.tooltip.CubaTooltip.java
License:Apache License
@Override protected void setTooltipText(TooltipInfo info) { super.setTooltipText(info); if (info.getTitle() != null && !info.getTitle().isEmpty()) { description.getElement().removeAttribute("aria-hidden"); } else {//from w w w .java 2 s . c o m description.getElement().setAttribute("aria-hidden", "true"); } String contextHelp = info.getContextHelp(); if (contextHelp != null && !contextHelp.isEmpty()) { if (info.isContextHelpHtmlEnabled()) { contextHelpElement.setInnerHTML(contextHelp); } else { if (contextHelp.contains("\n")) { contextHelp = WidgetUtil.escapeHTML(contextHelp).replace("\n", "<br/>"); contextHelpElement.setInnerHTML(contextHelp); } else { contextHelpElement.setInnerText(contextHelp); } } contextHelpElement.getStyle().clearDisplay(); } else { contextHelpElement.setInnerHTML(""); contextHelpElement.getStyle().setDisplay(Style.Display.NONE); } }