Search in sources :

Example 1 with SortedTreeModelWrapper

use of com.igormaznitsa.nbmindmap.nb.swing.SortedTreeModelWrapper in project netbeans-mmd-plugin by raydac.

the class MMDNavigator method updateContent.

private void updateContent() {
    if (this.treeModel != null) {
        this.treeModel.dispose();
    }
    final String text = getDocumentText();
    if (text != null) {
        try {
            this.treeModel = new SortedTreeModelWrapper(new MindMap(null, new StringReader(text)), this);
            this.mindMapTree.setModel(this.treeModel);
            Utils.foldUnfoldTree(this.mindMapTree, true);
        } catch (IOException ex) {
            // NOI18N
            LOGGER.error("Can't parse mind map text", ex);
            this.mindMapTree.setModel(null);
        }
    } else {
        this.mindMapTree.setModel(null);
    }
}
Also used : MindMap(com.igormaznitsa.mindmap.model.MindMap) StringReader(java.io.StringReader) IOException(java.io.IOException) SortedTreeModelWrapper(com.igormaznitsa.nbmindmap.nb.swing.SortedTreeModelWrapper)

Aggregations

MindMap (com.igormaznitsa.mindmap.model.MindMap)1 SortedTreeModelWrapper (com.igormaznitsa.nbmindmap.nb.swing.SortedTreeModelWrapper)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1