Beispiel #1
0
  private void setContent(String content) {
    this.content = content;

    contentColumn.removeAll();
    Component contentComp;
    if (isPreformated()) {
      contentComp =
          new DirectHtml("<pre style=\"font-size:11px;\">" + HtmlKit.encode(content) + "</pre>");
    } else if (isHtml()) {
      contentComp = new DirectHtml("<span style=\"font-size:11px;\">" + content + "</span>");
    } else {
      Label l = new Label(content);
      l.setFont(new Font(Font.MONOSPACE, Font.PLAIN, new Extent(11)));
      Column c = new Column();
      c.setInsets(new Insets(0, 10));
      c.add(l);
      contentComp = c;
    }
    contentColumn.add(contentComp);
  }