Search in sources :

Example 1 with RichTextModel

use of org.freeplane.features.text.RichTextModel in project freeplane by freeplane.

the class NoteWriter method writeContent.

/*
	 * (non-Javadoc)
	 * @see freeplane.io.INodeWriter#saveContent(freeplane.io.ITreeWriter,
	 * java.lang.Object, java.lang.String)
	 */
public void writeContent(final ITreeWriter writer, final Object element, final IExtension note) throws IOException {
    RichTextModel note1 = (RichTextModel) note;
    if (note1.getXml() != null) {
        final XMLElement htmlElement = new XMLElement();
        htmlElement.setName(NodeTextBuilder.XML_NODE_XHTML_CONTENT_TAG);
        if (note instanceof NoteModel) {
            htmlElement.setAttribute(NodeTextBuilder.XML_NODE_XHTML_TYPE_TAG, NodeTextBuilder.XML_NODE_XHTML_TYPE_NOTE);
        } else {
            htmlElement.setAttribute(NodeTextBuilder.XML_NODE_XHTML_TYPE_TAG, "UNKNOWN");
        }
        final String content = note1.getXml().replace('\0', ' ');
        writer.addElement('\n' + content + '\n', htmlElement);
    }
    return;
}
Also used : RichTextModel(org.freeplane.features.text.RichTextModel) XMLElement(org.freeplane.n3.nanoxml.XMLElement)

Aggregations

RichTextModel (org.freeplane.features.text.RichTextModel)1 XMLElement (org.freeplane.n3.nanoxml.XMLElement)1