com.instantbank.common.uiutils
Class DoubleDocument

java.lang.Object
  |
  +--javax.swing.text.AbstractDocument
        |
        +--javax.swing.text.PlainDocument
              |
              +--com.instantbank.common.uiutils.DoubleDocument
All Implemented Interfaces:
javax.swing.text.Document, java.io.Serializable

public class DoubleDocument
extends javax.swing.text.PlainDocument

Auxiliary class suited for restricting input for a JTextField to numeric "double" strings as expected by Java. It allows to end the string with a single period.

Author:
InstantBank (Rodrigo Lopez)
See Also:
Serialized Form

Inner classes inherited from class javax.swing.text.AbstractDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BidiElement, javax.swing.text.AbstractDocument.BidiRootElement, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
 
Fields inherited from class javax.swing.text.PlainDocument
added, defaultRoot, lineLimitAttribute, removed, tabSizeAttribute
 
Fields inherited from class javax.swing.text.AbstractDocument
AsyncLoadPriority, BAD_LOCATION, BAD_LOCK_STATE, BidiElementName, bidiRoot, ContentElementName, context, currWriter, data, defaultI18NProperty, documentProperties, ElementNameAttribute, I18NProperty, listenerList, MultiByteProperty, numReaders, ParagraphElementName, SectionElementName, segment
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
DoubleDocument()
           
 
Method Summary
 void insertString(int offset, java.lang.String s, javax.swing.text.AttributeSet attributeSet)
          Redefinition of the method from the PlainDocument class.
 
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertComposedTextUpdate, insertUpdate, removeUpdate
 
Methods inherited from class javax.swing.text.AbstractDocument
, addDocumentListener, addUndoableEditListener, calculateBidiLevels, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, isLeftToRight, postRemoveUpdate, putProperty, readLock, readObject, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, setAsynchronousLoadPriority, setDocumentProperties, updateBidi, writeLock, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

DoubleDocument

public DoubleDocument()
Method Detail

insertString

public void insertString(int offset,
                         java.lang.String s,
                         javax.swing.text.AttributeSet attributeSet)
                  throws javax.swing.text.BadLocationException
Redefinition of the method from the PlainDocument class.
Overrides:
insertString in class javax.swing.text.AbstractDocument
Parameters:
offset - Description of the Parameter
s - Description of the Parameter
attributeSet - Description of the Parameter
Throws:
javax.swing.text.BadLocationException - Description of the Exception