TableColdCell { public void setTooltip(final String tooltipText) { this.tooltip = Tooltip.builder(this.xmlUtil, tooltipText).build(); } TableColdCell(final XMLUtil xmlUtil); static TableColdCell create(final XMLUtil xmlUtil); String getCurrency(); void setCurrency(final String currency); void setColumnsSpanned(final int n); void setText(final Text text); void setTooltip(final String tooltipText); void setTooltip(final String tooltipText, final Length width, final Length height,
                           final boolean visible); void setTooltip(final Tooltip tooltip); void appendXMLToTable(final XMLUtil util, final Appendable appendable); boolean isCovered(); void setCovered(); void setFormula(final String formula); void setRowsSpanned(final int n); void setMatrixRowsSpanned(final int n); void setMatrixColumnsSpanned(final int n); void setAttribute(final String attribute, final CharSequence value);  }
@Test public final void testTooltip() throws IOException { this.coldCell.setTooltip("tooltip"); this.assertXMLEquals("<table:table-cell><office:annotation>" + "<text:p>tooltip</text:p>" + "</office:annotation></table:table-cell>"); }
@Test public final void testTooltipWithSize() throws IOException { this.coldCell.setTooltip("tooltip", SimpleLength.cm(1), SimpleLength.cm(2), true); this.assertXMLEquals("<table:table-cell>" + "<office:annotation office:display=\"true\" svg:width=\"1cm\" " + "svg:height=\"2cm\" svg:x=\"\">" + "<text:p>tooltip</text:p>" + "</office:annotation>" + "</table:table-cell>"); }
@Test public final void testTooltipWithSpecialChars() throws IOException { this.coldCell.setTooltip("<tooltip>"); this.assertXMLEquals( "<table:table-cell><office:annotation>" + "<text:p>&lt;tooltip&gt;</text:p>" + "</office:annotation></table:table-cell>"); }
@Test public final void testTooltipWithCR() throws IOException { this.coldCell.setTooltip("tooltip\nline 1\nline2"); this.assertXMLEquals( "<table:table-cell><office:annotation>" + "<text:p>tooltip</text:p><text:p>line " + "1</text:p><text:p>line2</text:p>" + "</office:annotation></table:table-cell>"); }