com.infoengine.modeler.UI
Class IntegerDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended bycom.infoengine.modeler.UI.IntegerDocument
All Implemented Interfaces:
Document, Serializable

public class IntegerDocument
extends PlainDocument

See Also:
Serialized Form

Nested Class Summary
 
Nested classes 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
IntegerDocument()
           
 
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.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, 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
 

Constructor Detail

IntegerDocument

public IntegerDocument()
Method Detail

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