Package com.portal.ctrl
Class FixedLengthPlainDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.portal.ctrl.FixedLengthPlainDocument
- All Implemented Interfaces:
Serializable
,Document
PlainDocument which restricts the length of it's content
- Version:
- %version: 1 % %date_modified: Mon Aug 02 16:52:21 1999 %
- Author:
- lruslen
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
-
Field Summary
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
ConstructorsConstructorDescriptionFixedLengthPlainDocument
(int maxLength) Create a new document with the given length. -
Method Summary
Modifier and TypeMethodDescriptionvoid
insertString
(int offset, String str, AttributeSet a) If this insertion would exceed the max document length, beep and do nothing else.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
-
Constructor Details
-
FixedLengthPlainDocument
public FixedLengthPlainDocument(int maxLength) Create a new document with the given length.
-
-
Method Details
-
insertString
If this insertion would exceed the max document length, beep and do nothing else. Otherwise, super.insertString() is called.- Specified by:
insertString
in interfaceDocument
- Overrides:
insertString
in classPlainDocument
- Throws:
BadLocationException
-