VLab Common 1.2

pl.psnc.vlab.util.gui.document
Class NormalizedDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by pl.psnc.vlab.util.gui.document.NormalizedDocument
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.Document

public class NormalizedDocument
extends javax.swing.text.PlainDocument

NormalizedDocument class - document is a container for text that serves as the model for swing text components. The document accepts only normalised characters and numbers.

Author:
Dominik Stoklosa (~osa~)
See Also:
Serialized Form
Email address
osa@man.poznan.pl

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
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
 
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
NormalizedDocument(javax.swing.JComponent component, int maxLength)
          Creates a new instance of NumberDocument
 
Method Summary
 void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet attr)
          Inserts a string of content.
 
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, 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
 

Constructor Detail

NormalizedDocument

public NormalizedDocument(javax.swing.JComponent component,
                          int maxLength)
Creates a new instance of NumberDocument

Parameters:
component - the source component
maxLength - maximum number of characters that may be inserted
Method Detail

insertString

public void insertString(int offset,
                         java.lang.String str,
                         javax.swing.text.AttributeSet attr)
                  throws javax.swing.text.BadLocationException
Inserts a string of content.

Specified by:
insertString in interface javax.swing.text.Document
Overrides:
insertString in class javax.swing.text.PlainDocument
Parameters:
offset - the offset into the document to insert the content >= 0. All positions that track change at or after the given location will move.
str - the string to insert
attr - the attributes to associate with the inserted content. This may be null if there are no attributes.
Throws:
javax.swing.text.BadLocationException - the given insert position is not a valid position within the document

VLab Common 1.2

Copyright 2004 by VLAB Dominik Stoklosa.