com.infoengine.modeler.UI
Class IntegerDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.infoengine.modeler.UI.IntegerDocument
- All Implemented Interfaces:
- Document, Serializable
- public class IntegerDocument
- extends PlainDocument
- See Also:
- Serialized Form
Method Summary |
private int |
checkInput(String proposedValue)
if there's something in the text component try to parse it into an
integer value |
void |
insertString(int offset,
String string,
AttributeSet attributes)
only add the data if doing so will not cause the contents of
the text component to be a non-integer
beep otherwise |
void |
remove(int offset,
int length)
really isn't possible to cause a value to become a non-integer
by removing data but validate anyways |
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, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntegerDocument
public IntegerDocument()
insertString
public void insertString(int offset,
String string,
AttributeSet attributes)
throws BadLocationException
- only add the data if doing so will not cause the contents of
the text component to be a non-integer
beep otherwise
- Throws:
BadLocationException
remove
public void remove(int offset,
int length)
throws BadLocationException
- really isn't possible to cause a value to become a non-integer
by removing data but validate anyways
- Throws:
BadLocationException
checkInput
private int checkInput(String proposedValue)
throws NumberFormatException
- if there's something in the text component try to parse it into an
integer value
- Throws:
NumberFormatException