javax.swing.text.html
Class HTMLDocument.FixedLengthDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended byjavax.swing.text.html.HTMLDocument.FixedLengthDocument
All Implemented Interfaces:
Document, Serializable
Enclosing class:
HTMLDocument

private static class HTMLDocument.FixedLengthDocument
extends PlainDocument

Document that allows you to set the maximum length of the text.


Nested Class Summary
 
Nested classes inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
 
Field Summary
private  int maxLength
           
 
Fields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
HTMLDocument.FixedLengthDocument(int maxLength)
           
 
Method Summary
 void insertString(int offset, String str, AttributeSet a)
          Inserts some content into the document.
 
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
 
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxLength

private int maxLength
Constructor Detail

HTMLDocument.FixedLengthDocument

public HTMLDocument.FixedLengthDocument(int maxLength)
Method Detail

insertString

public void insertString(int offset,
                         String str,
                         AttributeSet a)
                  throws BadLocationException
Description copied from class: PlainDocument
Inserts some content into the document. Inserting content causes a write lock to be held while the actual changes are taking place, followed by notification to the observers on the thread that grabbed the write lock.

This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.

Specified by:
insertString in interface Document
Overrides:
insertString in class PlainDocument
Parameters:
offset - the starting offset >= 0
str - the string to insert; does nothing with null/empty strings
a - the attributes for the inserted content
Throws:
BadLocationException - the given insert position is not a valid position within the document
See Also:
Document.insertString(int, java.lang.String, javax.swing.text.AttributeSet)