Java Code Examples for javax.swing.text.Document#toString()

The following examples show how to use javax.swing.text.Document#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Utilities.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Display the identity of the document together with the title property
 * and stream-description property.
 */
public static String debugDocument(Document doc) {
    return "<" + System.identityHashCode(doc) // NOI18N
        + ", title='" + doc.getProperty(Document.TitleProperty)
        + "', stream='" + doc.getProperty(Document.StreamDescriptionProperty)
        + ", " + doc.toString() + ">"; // NOI18N
}
 
Example 2
Source File: ParserManager.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static void printManagers () {
    System.out.println("\nParserManagers:");
    Iterator<Document> it = managers.keySet ().iterator ();
    while (it.hasNext ()) {
        Document document =  it.next ();
        String title = (String) document.getProperty("title");
        if (title == null)
            title = document.toString();
        WeakReference wr = managers.get (document);
        if (wr.get () != null)
            System.out.println("  " + title);
    }
}