com.jmex.bui.text
Class LengthLimitedDocument

java.lang.Object
  extended by com.jmex.bui.text.Document
      extended by com.jmex.bui.text.LengthLimitedDocument

public class LengthLimitedDocument
extends Document

A document for use with a BTextField that limits the input to a maximum length.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jmex.bui.text.Document
Document.Listener
 
Field Summary
protected  int _maxLength
           
 
Fields inherited from class com.jmex.bui.text.Document
_listeners, _text
 
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.jmex.bui.text.Document
addListener, getLength, getText, getText, insert, notify, remove, removeListener, replace, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_maxLength

protected int _maxLength
Constructor Detail

LengthLimitedDocument

public LengthLimitedDocument(int maxLength)
Creates a document that will limit its maximum length to the specified value.

Method Detail

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.


Copyright © 2008 Michael Bayne. All Rights Reserved.