List of usage examples for javax.swing.text View getAttributes
public AttributeSet getAttributes()
From source file:ShowHTMLViews.java
public static void displayView(View view, int indent, Document doc, PrintStream out) { String name = view.getClass().getName(); for (int i = 0; i < indent; i++) { out.print(" "); }/*from w w w. j a v a2s.co m*/ int start = view.getStartOffset(); int end = view.getEndOffset(); out.println(name + "; offsets [" + start + ", " + end + "]"); for (int i = 0; i < indent; i++) { out.print(" "); } HTMLDocDisplay.displayAttributes(view.getAttributes(), indent, out); int viewCount = view.getViewCount(); if (viewCount == 0) { int length = Math.min(32, end - start); try { String txt = doc.getText(start, length); for (int i = 0; i < indent + 1; i++) { out.print(" "); } out.println("[" + txt + "]"); } catch (BadLocationException e) { } } else { for (int i = 0; i < viewCount; i++) { displayView(view.getView(i), indent + 1, doc, out); } } out.println(""); }