Esempio n. 1
0
 /**
  * Generates HTML for a tree item with an attached icon.
  *
  * @param imageProto the image prototype to use
  * @param title the title of the item
  * @return the resultant HTML
  */
 private HTML imageItemHTML(ImageResource res, String title) {
   AbstractImagePrototype imageProto = AbstractImagePrototype.create(res);
   HTML label = new HTML(imageProto.getHTML() + " " + title);
   label.addClickHandler(this);
   label.addClickHandler((ClickHandler) parent);
   return label;
 }
Esempio n. 2
0
 /**
  * Creates an HTML fragment that places an image & caption together, for use in a group header.
  *
  * @param imageProto an image prototype for an image
  * @param caption the group caption
  * @return the header HTML fragment
  */
 private String createHeaderHTML(AbstractImagePrototype imageProto, String caption) {
   String captionHTML =
       "<table class='caption' cellpadding='0' "
           + "cellspacing='0'>"
           + "<tr><td class='lcaption'>"
           + imageProto.getHTML()
           + "</td><td id ="
           + caption
           + " class='rcaption'><b style='white-space:nowrap'>&nbsp;"
           + caption
           + "</b></td></tr></table>";
   return captionHTML;
 }
  private static SafeHtml makeImage(ImageResource resource) {
    AbstractImagePrototype image = AbstractImagePrototype.create(resource);
    String html = image.getHTML();

    return SafeHtmlUtils.fromTrustedString(html);
  }