com.threerings.opengl.gui.text
Class LengthLimitedDocument
java.lang.Object
com.threerings.opengl.gui.text.Document
com.threerings.opengl.gui.text.LengthLimitedDocument
public class LengthLimitedDocument
- extends Document
A document for use with a TextField that limits the input to a
maximum length.
|
Constructor Summary |
LengthLimitedDocument(int maxLength)
Creates a document that will limit its maximum length to the specified
value. |
|
Method Summary |
protected boolean |
validateEdit(String oldText,
String newText)
Provides an opportunity for edits to be rejected before being applied to
the document. |
| Methods inherited from class com.threerings.opengl.gui.text.Document |
addListener, addUndoableEditListener, getLength, getText, getText, getWordExtents, indexOfWordEnd, insert, lastIndexOfWordStart, notify, remove, removeListener, removeUndoableEditListener, replace, setText |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_maxLength
protected int _maxLength
LengthLimitedDocument
public LengthLimitedDocument(int maxLength)
- Creates a document that will limit its maximum length to the specified
value.
validateEdit
protected boolean validateEdit(String oldText,
String newText)
- Description copied from class:
Document
- Provides an opportunity for edits to be rejected before being applied to
the document.
- Overrides:
validateEdit in class Document
- Returns:
- true if the document should be configured with the specified new
text, false if the old text should remain.