Example usage for com.vaadin.client TooltipInfo getTitle

List of usage examples for com.vaadin.client TooltipInfo getTitle

Introduction

In this page you can find the example usage for com.vaadin.client TooltipInfo getTitle.

Prototype

public String getTitle() 

Source Link

Document

Gets the tooltip title.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.tooltip.CubaTooltip.java

License:Apache License

@Override
protected void setTooltipText(TooltipInfo info) {
    super.setTooltipText(info);

    if (info.getTitle() != null && !info.getTitle().isEmpty()) {
        description.removeAttribute("aria-hidden");
    } else {//ww w .jav a 2s. c om
        description.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);
    }
}

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 {//w  w  w  .j  a  va2  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);
    }
}