Example usage for javax.swing.text.html HTMLWriter write

List of usage examples for javax.swing.text.html HTMLWriter write

Introduction

In this page you can find the example usage for javax.swing.text.html HTMLWriter write.

Prototype

public void write() throws IOException, BadLocationException 

Source Link

Document

Iterates over the Element tree and controls the writing out of all the tags and its attributes.

Usage

From source file:plugin.notes.gui.NotesTreeNode.java

/** Saves this node's data. */
public void save() {
    if (dirty) {/*from  www.  j a  v a  2 s  . c o  m*/
        try {
            File notes = new File(dir.getAbsolutePath() + File.separator + DATA_HTML);

            if (!notes.exists()) {
                notes.createNewFile();
            }

            if (pane != null) {
                FileWriter fw = new FileWriter(notes);
                HTMLWriter hw = new HTMLWriter(fw, notesDoc);
                hw.write();
                fw.flush();
                fw.close();
                dirty = false;
            }
        } catch (Exception e) {
            Logging.errorPrint(e.getMessage(), e);
        }
    }
}