Class SizeLimitedDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
org.openpdf.simple.extend.form.SizeLimitedDocument
- All Implemented Interfaces:
Serializable, Document
When applied to a Swing component, limits the total number of
characters that can be entered.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement -
Field Summary
FieldsFields inherited from class PlainDocument
lineLimitAttribute, tabSizeAttributeFields inherited from class AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameFields inherited from interface Document
StreamDescriptionProperty, TitleProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinsertString(int offset, @Nullable String str, AttributeSet attr) Methods inherited from class PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdateMethods inherited from class 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
-
Field Details
-
_maximumLength
private final int _maximumLength
-
-
Constructor Details
-
SizeLimitedDocument
public SizeLimitedDocument(int maximumLength)
-
-
Method Details
-
insertString
public void insertString(int offset, @Nullable String str, AttributeSet attr) throws BadLocationException - Specified by:
insertStringin interfaceDocument- Overrides:
insertStringin classPlainDocument- Throws:
BadLocationException
-