net.sourceforge.squirrel_sql.plugins.refactoring.gui.util
Class NumberDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
net.sourceforge.squirrel_sql.plugins.refactoring.gui.util.NumberDocument
- All Implemented Interfaces:
- Serializable, Document
public class NumberDocument
- extends PlainDocument
- implements Document
A document that only holds numeric values.
- See Also:
- Serialized Form
|
Constructor Summary |
NumberDocument()
Create an instance with no maximum length. |
NumberDocument(int length)
Create an instance with a maximum length. |
NumberDocument(int length,
boolean fractional)
Create an instance with a maximum length that allowes floating point numbers. |
NumberDocument(int length,
String specialValid)
Create an instance with a maximum length and special characters that are allowed. |
| 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, remove, 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 |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
NumberDocument
public NumberDocument()
- Create an instance with no maximum length.
NumberDocument
public NumberDocument(int length)
- Create an instance with a maximum
length.
- Parameters:
length - maximum length
NumberDocument
public NumberDocument(int length,
String specialValid)
- Create an instance with a maximum
length and special characters that are allowed.
- Parameters:
length - maximum lengthspecialValid - special characters that are allowed
NumberDocument
public NumberDocument(int length,
boolean fractional)
- Create an instance with a maximum
length that allowes floating point numbers.
- Parameters:
length - maximum lengthfractional - true enables floating point numbers, false allowes only integers.
insertString
public void insertString(int i,
String string,
AttributeSet attributeSet)
throws BadLocationException
- Inserts some content into the document. Inserting content causes a write lock to be held while the actual
changes are taking place, followed by notification to the observers on the thread that grabbed the write lock.
This override checks if
string contains only valid characters. Default: numbers 0-9
- Specified by:
insertString in interface Document- Overrides:
insertString in class PlainDocument
- Parameters:
i - the starting offset >= 0string - the string to insert; does nothing with null/empty stringsattributeSet - the attributes for the inserted content
- Throws:
BadLocationException - the given insert position is not a valid position within the document
Copyright © 2001-2012. All Rights Reserved.