public class FormattedDocument extends javax.swing.text.PlainDocument
Modified by: Joseph A. Huwaldt
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
Constructor and Description |
---|
FormattedDocument(java.text.Format f)
Construct a formatted document that uses the supplied Format object.
|
Modifier and Type | Method and Description |
---|---|
java.text.Format |
getFormat()
Method that returns the Format used by this document.
|
void |
insertString(int offs,
java.lang.String str,
javax.swing.text.AttributeSet a)
Inserts some content into the document using the documents Format to validate
what has be inserted.
|
void |
remove(int offs,
int len)
Removes some content from the document.
|
getDefaultRootElement, getParagraphElement
addDocumentListener, addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties
public FormattedDocument(java.text.Format f)
public java.text.Format getFormat()
public void insertString(int offs, 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
offs
- the starting offset >= 0str
- the string to insert; does nothing with null/empty stringsa
- the attributes for the inserted contentjavax.swing.text.BadLocationException
public void remove(int offs, int len) throws javax.swing.text.BadLocationException
remove
in interface javax.swing.text.Document
remove
in class javax.swing.text.AbstractDocument
offs
- the starting offset >= 0len
- the number of characters to remove >= 0javax.swing.text.BadLocationException