API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. AbstractDocument View Source
Author(s)
Timothy Prinzing
Since
Version
1.157 04/07/06
Serial
Hierarchy
 Object
      AbstractDocument
Implements
 Document
 Serializable
Subclasses
Description
publicabstract abstract class AbstractDocument
  An implementation of the document interface to serve as a basis for implementing various kinds of documents.
See also:   
Constructors
protected AbstractDocument (Content data)
  Constructs a new AbstractDocument, wrapped around some specified content storage mechanism.
protected AbstractDocument (Content data, AttributeContext context)
  Constructs a new AbstractDocument, wrapped around some specified content storage mechanism.
Methods
Hide/Show inherited methods
public void addDocumentListener (DocumentListener listener) [Specified in Document]
  Adds a document listener for notification of any changes.
public void addUndoableEditListener (UndoableEditListener listener) [Specified in Document]
  Adds an undo listener for notification of any changes.
protected Element createBranchElement (Element parent, AttributeSet a)
  Creates a document branch element, that can contain other elements.
protected Element createLeafElement (Element parent, AttributeSet a, int p0, int p1)
  Creates a document leaf element.
publicsynchronized Position createPosition (int offs) throws BadLocationException [Specified in Document]
  Returns a position that will track change as the document is altered.
public void dump (PrintStream out)
  Gives a diagnostic dump.
protected void fireChangedUpdate (DocumentEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireInsertUpdate (DocumentEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireRemoveUpdate (DocumentEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireUndoableEditUpdate (UndoableEditEvent e)
  Notifies all listeners that have registered interest for notification on this event type.
public int getAsynchronousLoadPriority ()
  Gets the asynchronous loading priority.
protectedfinal AttributeContext getAttributeContext ()
  Fetches the context for managing attributes.
public Element getBidiRootElement ()
  Returns the root element of the bidirectional structure for this document.
protectedfinal Content getContent ()
  Gets the content for the document.
protectedfinalsynchronized Thread getCurrentWriter ()
  Fetches the current writing thread if there is one.
publicabstract Element getDefaultRootElement () [Specified in Document]
  Returns the root element that views should be based upon unless some other mechanism for assigning views to element structures is provided.
public DocumentFilter getDocumentFilter ()
  Returns the DocumentFilter that is responsible for filtering of insertion/removal.
public DocumentListener getDocumentListeners ()
  Returns an array of all the document listeners registered on this document.
public Dictionary<Object, Object> getDocumentProperties ()
  Supports managing a set of properties.
publicfinal Position getEndPosition () [Specified in Document]
  Returns a position that represents the end of the document.
public int getLength () [Specified in Document]
  Returns the length of the data.
public T getListeners (Class< T> listenerType)
  Returns an array of all the objects currently registered as FooListeners upon this document.
publicabstract Element getParagraphElement (int pos)
  Get the paragraph element containing the given position.
publicfinal Object getProperty (Object key) [Specified in Document]
  A convenience method for looking up a property value.
public Element getRootElements () [Specified in Document]
  Gets all root elements defined.
publicfinal Position getStartPosition () [Specified in Document]
  Returns a position that represents the start of the document.
public String getText (int offset, int length) throws BadLocationException [Specified in Document]
  Gets a sequence of text from the document.
public void getText (int offset, int length, Segment txt) throws BadLocationException [Specified in Document]
  Fetches the text contained within the given portion of the document.
public UndoableEditListener getUndoableEditListeners ()
  Returns an array of all the undoable edit listeners registered on this document.
pack-private void handleInsertString (int offs, String str, AttributeSet a) throws BadLocationException
Performs the actual work of inserting the text; it is assumed the caller has obtained a write lock before invoking this.
pack-private void handleRemove (int offs, int len) throws BadLocationException
  Performs the actual work of the remove.
public void insertString (int offs, String str, AttributeSet a) throws BadLocationException [Specified in Document]
  Inserts some content into the document.
protected void insertUpdate (DefaultDocumentEvent chng, AttributeSet attr)
  Updates document structure as a result of text insertion.
pack-private boolean isLeftToRight (int p0, int p1)
Returns true if the text in the range p0 to p1 is left to right.
protected void postRemoveUpdate (DefaultDocumentEvent chng)
  Updates any document structure as a result of text removal.
publicfinal void putProperty (Object key, Object value) [Specified in Document]
  A convenience method for storing up a property value.
publicfinalsynchronized void readLock ()
  Acquires a lock to begin reading some state from the document.
publicfinalsynchronized void readUnlock ()
  Does a read unlock.
public void remove (int offs, int len) throws BadLocationException [Specified in Document]
  Removes some content from the document.
public void removeDocumentListener (DocumentListener listener) [Specified in Document]
  Removes a document listener.
public void removeUndoableEditListener (UndoableEditListener listener) [Specified in Document]
  Removes an undo listener.
protected void removeUpdate (DefaultDocumentEvent chng)
  Updates any document structure as a result of text removal.
public void render (Runnable r) [Specified in Document]
  This allows the model to be safely rendered in the presence of currency, if the model supports being updated asynchronously.
public void replace (int offset, int length, String text, AttributeSet attrs) throws BadLocationException
  Deletes the region of text from offset to offset + length, and replaces it with text.
public void setAsynchronousLoadPriority (int p)
  Sets the asynchronous loading priority.
public void setDocumentFilter (DocumentFilter filter)
  Sets the DocumentFilter.
public void setDocumentProperties (Dictionary<Object, Object> x)
  Replaces the document properties dictionary for this document.
pack-private void updateBidi (DefaultDocumentEvent chng)
  Update the bidi element structure as a result of the given change to the document.
protectedfinalsynchronized void writeLock ()
  Acquires a lock to begin mutating the document this lock protects.
protectedfinalsynchronized void writeUnlock ()
  Releases a write lock previously obtained via writeLock.
Fields
Hide/Show inherited fields
pack-privatefinalstatic String AsyncLoadPriority = "load priority"
Document property that indicates asynchronous loading is desired, with the thread priority given as the value.
protectedfinalstatic String BAD_LOCATION = "document location failure"
Error message to indicate a bad location.
publicfinalstatic String BidiElementName = "bidi level"
Name of elements used to hold a unidirectional run
publicfinalstatic String ContentElementName = "content"
Name of elements used to represent content
publicfinalstatic String ElementNameAttribute = "$ename"
Name of the attribute used to specify element names.
pack-privatefinalstatic String I18NProperty = "i18n"
  Document property that indicates whether internationalization functions such as text reordering or reshaping should be performed.
protected EventListenerList listenerList
The event listener list for the document.
pack-privatefinalstatic Object MultiByteProperty
  Document property that indicates if a character has been inserted into the document that is more than one byte long.
publicfinalstatic String ParagraphElementName = "paragraph"
Name of elements used to represent paragraphs
publicfinalstatic String SectionElementName = "section"
Name of elements used to hold sections (lines/paragraphs).
publicfinalstatic String StreamDescriptionProperty = "stream" [Inherited From Document]
  The property name for the description of the stream used to initialize the document.
publicfinalstatic String TitleProperty = "title" [Inherited From Document]
The property name for the title of the document, if there is one.
Nested Classes
  AbstractDocument.Content
Interface to describe a sequence of character content that can be edited.
  AbstractDocument.AttributeContext
An interface that can be used to allow MutableAttributeSet implementations to use pluggable attribute compression techniques.
  AbstractDocument.AbstractElement
Implements the abstract part of an element.
  AbstractDocument.BranchElement
Implements a composite element that contains other elements.
  AbstractDocument.LeafElement
Implements an element that directly represents content of some kind.
  AbstractDocument.BidiRootElement
Represents the root element of the bidirectional element structure.
  AbstractDocument.BidiElement
Represents an element of the bidirectional element structure.
  AbstractDocument.DefaultDocumentEvent
Stores document changes as the document is being modified.
  AbstractDocument.UndoRedoDocumentEvent
This event used when firing document changes while Undo/Redo operations.
  AbstractDocument.ElementEdit
An implementation of ElementChange that can be added to the document event.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar