Example usage for javax.swing.text StyledDocument getRootElements

List of usage examples for javax.swing.text StyledDocument getRootElements

Introduction

In this page you can find the example usage for javax.swing.text StyledDocument getRootElements.

Prototype

public Element[] getRootElements();

Source Link

Document

Returns all of the root elements that are defined.

Usage

From source file:com.hexidec.ekit.EkitCore.java

/**
 * Method for describing the node hierarchy of the document
 *//*from ww w. j ava2 s.co m*/
private void describeDocument(StyledDocument doc) {
    Element[] elements = doc.getRootElements();

    for (Element elem : elements) {
        indent = indentStep;
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < indent; j++) {
            sb.append(" ");
        }
        sb.append(elem);
        traverseElement(elem, sb);
        log.debug(sb);
    }
}