swingwtx.swing.text
Class AbstractDocument

java.lang.Object
  extended byswingwtx.swing.text.AbstractDocument
All Implemented Interfaces:
Document, java.io.Serializable
Direct Known Subclasses:
PlainDocument

public abstract class AbstractDocument
extends java.lang.Object
implements Document, java.io.Serializable

Main implementation of document support.

See Also:
Serialized Form

Nested Class Summary
 class AbstractDocument.AbstractElement
          Sub-classes
static interface AbstractDocument.AttributeContext
           
 class AbstractDocument.BranchElement
           
static interface AbstractDocument.Content
          Interfaces:
 class AbstractDocument.DefaultDocumentEvent
           
static class AbstractDocument.ElementEdit
           
 class AbstractDocument.LeafElement
           
 
Field Summary
protected  AbstractDocument.Content content
          The document content
protected  java.util.Vector documentListeners
          Document listeners
protected  java.util.Hashtable props
          Properties
protected  java.util.Vector undoListeners
          Undo listeners
 
Fields inherited from interface swingwtx.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
AbstractDocument()
           
 
Method Summary
 void addDocumentListener(DocumentListener listener)
           
 void addUndoableEditListener(UndoableEditListener listener)
           
 Position createPosition(int offs)
           
protected  void fireDocumentEvent(DocumentEvent e)
          Fires document change events to listeners
 DocumentFilter getDocumentFilter()
           
 Position getEndPosition()
           
 DocumentFilter.FilterBypass getFilterBypass()
           
 int getLength()
           
abstract  Element getParagraphElement(int pos)
           
 java.lang.Object getProperty(java.lang.Object key)
           
 Element[] getRootElements()
          FIXME: NOT IMPLEMENTED
 Position getStartPosition()
           
 java.lang.String getText(int offset, int length)
           
 void getText(int offset, int length, Segment txt)
           
 void insertString(int offset, java.lang.String str, AttributeSet a)
          FIXME: Need to work with UndoManager ?
 void putProperty(java.lang.Object key, java.lang.Object value)
           
 void remove(int offs, int len)
          FIXME: Need to work with UndoManager ?
 void removeDocumentListener(DocumentListener listener)
           
 void removeUndoableEditListener(UndoableEditListener listener)
           
 void render(java.lang.Runnable r)
          FIXME: What the hell is this routine for?
 void setDocumentFilter(DocumentFilter documentFilter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface swingwtx.swing.text.Document
getDefaultRootElement
 

Field Detail

content

protected AbstractDocument.Content content
The document content


documentListeners

protected java.util.Vector documentListeners
Document listeners


undoListeners

protected java.util.Vector undoListeners
Undo listeners


props

protected java.util.Hashtable props
Properties

Constructor Detail

AbstractDocument

public AbstractDocument()
Method Detail

getParagraphElement

public abstract Element getParagraphElement(int pos)

getLength

public int getLength()
Specified by:
getLength in interface Document
Returns:
the content length

addDocumentListener

public void addDocumentListener(DocumentListener listener)
Specified by:
addDocumentListener in interface Document

removeDocumentListener

public void removeDocumentListener(DocumentListener listener)
Specified by:
removeDocumentListener in interface Document

addUndoableEditListener

public void addUndoableEditListener(UndoableEditListener listener)
Specified by:
addUndoableEditListener in interface Document

removeUndoableEditListener

public void removeUndoableEditListener(UndoableEditListener listener)
Specified by:
removeUndoableEditListener in interface Document

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Specified by:
getProperty in interface Document

putProperty

public void putProperty(java.lang.Object key,
                        java.lang.Object value)
Specified by:
putProperty in interface Document

remove

public void remove(int offs,
                   int len)
            throws BadLocationException
FIXME: Need to work with UndoManager ?

Specified by:
remove in interface Document
Throws:
BadLocationException

insertString

public void insertString(int offset,
                         java.lang.String str,
                         AttributeSet a)
                  throws BadLocationException
FIXME: Need to work with UndoManager ?

Specified by:
insertString in interface Document
Throws:
BadLocationException

getText

public java.lang.String getText(int offset,
                                int length)
                         throws BadLocationException
Specified by:
getText in interface Document
Throws:
BadLocationException

getText

public void getText(int offset,
                    int length,
                    Segment txt)
             throws BadLocationException
Specified by:
getText in interface Document
Throws:
BadLocationException

getStartPosition

public Position getStartPosition()
Specified by:
getStartPosition in interface Document

getEndPosition

public Position getEndPosition()
Specified by:
getEndPosition in interface Document

createPosition

public Position createPosition(int offs)
                        throws BadLocationException
Specified by:
createPosition in interface Document
Throws:
BadLocationException

getRootElements

public Element[] getRootElements()
FIXME: NOT IMPLEMENTED

Specified by:
getRootElements in interface Document

render

public void render(java.lang.Runnable r)
FIXME: What the hell is this routine for?

Specified by:
render in interface Document

getDocumentFilter

public DocumentFilter getDocumentFilter()

setDocumentFilter

public void setDocumentFilter(DocumentFilter documentFilter)

getFilterBypass

public DocumentFilter.FilterBypass getFilterBypass()

fireDocumentEvent

protected void fireDocumentEvent(DocumentEvent e)
Fires document change events to listeners