org.tentackle.ui
Class FormFieldDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by org.tentackle.ui.FormFieldDocument
All Implemented Interfaces:
Serializable, Document

public class FormFieldDocument
extends PlainDocument

Document for FormFieldComponents.

Author:
harald
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces 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
FormFieldDocument(FormFieldComponent field)
          Creates a form field document.
 
Method Summary
 StringConverter getConverter()
          Gets the current converter.
 void insertString(int offs, String str, AttributeSet a)
          Inserts some content into the document.
 void remove(int offs, int len)
          Removes some content from the document.
 void setConverter(StringConverter converter)
          Sets the string converter.
 
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

FormFieldDocument

public FormFieldDocument(FormFieldComponent field)
Creates a form field document.

Parameters:
field - the form field component
Method Detail

getConverter

public StringConverter getConverter()
Gets the current converter. Default is null.

Returns:
the converter.

setConverter

public void setConverter(StringConverter converter)
Sets the string converter.

Parameters:
converter - the string converter

insertString

public void insertString(int offs,
                         String str,
                         AttributeSet a)
                  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 method is thread safe, although most Swing methods are not. Please see How to Use Threads for more information.

Overridden to implement autoSelect, character conversion, valid and invalid character check, filler, insert/override, maxColumns, adjustment, etc...

Specified by:
insertString in interface Document
Overrides:
insertString in class PlainDocument
Parameters:
offs - the starting offset >= 0
str - the string to insert; does nothing with null/empty strings
a - the attributes for the inserted content
Throws:
BadLocationException - the given insert position is not a valid position within the document
See Also:
Document.insertString(int, java.lang.String, javax.swing.text.AttributeSet)

remove

public void remove(int offs,
                   int len)
            throws BadLocationException
Description copied from class: javax.swing.text.AbstractDocument
Removes some content from the document. Removing content causes a write lock to be held while the actual changes are taking place. Observers are notified of the change on the thread that called this method.

This method is thread safe, although most Swing methods are not. Please see How to Use Threads for more information.

Specified by:
remove in interface Document
Overrides:
remove in class AbstractDocument
Parameters:
offs - the starting offset >= 0
len - the number of characters to remove >= 0
Throws:
BadLocationException - the given remove position is not a valid position within the document
See Also:
Document.remove(int, int)


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de