Esempio n. 1
0
  public RichTooltip createTooltip() {
    String body = (String) getValue(TOOLTIP_BODY);
    if (body == null) {
      body = (String) getValue(Action.LONG_DESCRIPTION);
    }
    if (body == null) {
      body = getDescription();
    }
    if (body == null) {
      return null;
    }

    String title = (String) getValue(TOOLTIP_TITLE);
    if (title == null) {
      title = getText();
    }

    RichTooltip tooltip = new RichTooltip(title, body);

    String titleIcon = (String) getValue(TOOLTIP_ICON);
    if (titleIcon != null) {
      tooltip.setMainImage(ImageUtilities.loadImage(titleIcon));
    } else {
      tooltip.setMainImage(getLargeImage());
    }

    String footer = (String) getValue(TOOLTIP_FOOTER);
    if (footer != null) {
      tooltip.addFooterSection(footer);
      String footerIcon = (String) getValue(TOOLTIP_FOOTER_ICON);
      if (footerIcon != null) {
        tooltip.setFooterImage(ImageUtilities.loadImage(footerIcon));
      }
    }
    return tooltip;
  }