* @param note
* note content.
*/
public void setNoteText(String note) {
splitRepeatedCells();
OfficeAnnotationElement annotation = OdfElement.findFirstChildNode(OfficeAnnotationElement.class, mCellElement);
if (annotation == null) {
OdfFileDom dom = (OdfFileDom) mCellElement.getOwnerDocument();
annotation = (OfficeAnnotationElement) OdfXMLFactory.newOdfElement(dom, OdfName.newName(
OdfDocumentNamespace.OFFICE, "annotation"));
}
TextPElement noteElement = OdfElement.findFirstChildNode(TextPElement.class, annotation);
if (noteElement == null) {
noteElement = annotation.newTextPElement();
}
noteElement.setTextContent(note);
DcCreatorElement dcCreatorElement = OdfElement.findFirstChildNode(DcCreatorElement.class, annotation);
if (dcCreatorElement == null) {
dcCreatorElement = annotation.newDcCreatorElement();
}
dcCreatorElement.setTextContent(System.getProperty("user.name"));
String dcDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(new Date());
DcDateElement dcDateElement = OdfElement.findFirstChildNode(DcDateElement.class, annotation);
if (dcDateElement == null) {
dcDateElement = annotation.newDcDateElement();
}
dcDateElement.setTextContent(dcDate);
mCellElement.appendChild(annotation);
}