public class Integer_Document
extends javax.swing.text.PlainDocument
PlainDocument
that allows only those characters suitable for an
integer number. These only include the ten digits 0123456789 plus the comma
to allow lists of integers. All other
characters are ignored and never become part of the
Integer_Document's content. This class is a very minor
modification to Number_Document
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, 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
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
Constructor and Description |
---|
Integer_Document()
Creates a new Integer_Document using the
PlainDocument 's
default content container. |
Integer_Document(javax.swing.text.AbstractDocument.Content container)
Creates a new Integer_Document using the specified container for the
document's content.
|
Modifier and Type | Method and Description |
---|---|
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
Inserts content into the document.
|
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
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
public static final java.lang.String ID
public Integer_Document()
PlainDocument
's
default content container.PlainDocument.PlainDocument()
public Integer_Document(javax.swing.text.AbstractDocument.Content container)
container
- the document's content container.PlainDocument.PlainDocument(AbstractDocument.Content)
public void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a) throws javax.swing.text.BadLocationException
insertString
in interface javax.swing.text.Document
insertString
in class javax.swing.text.PlainDocument
offset
- the starting offset, at least 0.str
- the string to insert; null/empty strings are not inserted.a
- the attributes for the inserted content; this document does not
use attributes.javax.swing.text.BadLocationException
PlainDocument.insertString(int, java.lang.String, javax.swing.text.AttributeSet)
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona