Example usage for javax.swing.text AttributeSet getResolveParent

List of usage examples for javax.swing.text AttributeSet getResolveParent

Introduction

In this page you can find the example usage for javax.swing.text AttributeSet getResolveParent.

Prototype

public AttributeSet getResolveParent();

Source Link

Document

Gets the resolving parent.

Usage

From source file:ShowHTMLViews.java

public static void displayAttributes(AttributeSet a, int indent, PrintStream out) {
    if (a == null)
        return;/*from  w w w . ja  va 2  s . co m*/

    a = a.copyAttributes();
    Enumeration x = a.getAttributeNames();
    for (int i = 0; i < indent; i++) {
        out.print("  ");
    }
    if (x != null) {
        out.println("ATTRIBUTES:");
        while (x.hasMoreElements()) {

            for (int i = 0; i < indent; i++) {
                out.print("  ");
            }
            Object attr = x.nextElement();
            out.println(
                    " (" + attr + ", " + a.getAttribute(attr) + ")" + " [" + getShortClassName(attr.getClass())
                            + "/" + getShortClassName(a.getAttribute(attr).getClass()) + "] ");
        }
    } else {
        out.println("No attributes");
    }
    if (a.getResolveParent() != null) {
        displayAttributes(a.getResolveParent().copyAttributes(), indent + 1, out);
    }
}