| javax.swing.text.PlainDocument org.jfree.ui.LengthLimitingDocument
LengthLimitingDocument | public class LengthLimitingDocument extends PlainDocument (Code) | | This Document restricts the size of the contained plain text to the given number of
characters.
author: Thomas Morgner |
Method Summary | |
public int | getMaxLength() Returns the defined maximum number characters for this document. | public void | insertString(int offs, String str, AttributeSet a) Inserts the string into the document. | public void | setMaxLength(int maxlen) Sets the maximum number of characters for this document. |
LengthLimitingDocument | public LengthLimitingDocument()(Code) | | Creates a new LengthLimitingDocument, with no limitation.
|
LengthLimitingDocument | public LengthLimitingDocument(int maxlen)(Code) | | Creates a new LengthLimitingDocument with the given limitation. No more than
maxlen characters can be added to the document. If maxlen is negative, then
no length check is performed.
Parameters: maxlen - the maximum number of elements in this document |
getMaxLength | public int getMaxLength()(Code) | | Returns the defined maximum number characters for this document.
the maximum number of characters |
insertString | public void insertString(int offs, String str, AttributeSet a) throws BadLocationException(Code) | | Inserts the string into the document. If the length of the document would
violate the maximum characters restriction, then the string is cut down so
that
Parameters: offs - the offset, where the string should be inserted into the document Parameters: str - the string that should be inserted Parameters: a - the attribute set assigned for the document throws: javax.swing.text.BadLocationException - if the offset is not correct |
setMaxLength | public void setMaxLength(int maxlen)(Code) | | Sets the maximum number of characters for this document. Existing characters
are not removed.
Parameters: maxlen - the maximum number of characters in this document. |
|
|