API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. PlainDocument View Source
Author(s)
Timothy Prinzing
Since
Version
1.45 11/17/05
Serial
Hierarchy
 Object
      AbstractDocument
          PlainDocument
Implements
Subclasses
Description
public class PlainDocument
  A plain document that maintains no character attributes.
See also:    Document AbstractDocument
Constructors
public PlainDocument ()
  Constructs a plain text document.
public PlainDocument (Content c)
  Constructs a plain text document.
Methods
Hide/Show inherited methods
public void addDocumentListener (DocumentListener listener) [Inherited From AbstractDocument]
  Adds a document listener for notification of any changes.
public void addUndoableEditListener (UndoableEditListener listener) [Inherited From AbstractDocument]
  Adds an undo listener for notification of any changes.
protected Element createBranchElement (Element parent, AttributeSet a) [Inherited From AbstractDocument]
  Creates a document branch element, that can contain other elements.
protected AbstractElement createDefaultRoot ()
  Creates the root element to be used to represent the default document structure.
protected Element createLeafElement (Element parent, AttributeSet a, int p0, int p1) [Inherited From AbstractDocument]
  Creates a document leaf element.
publicsynchronized Position createPosition (int offs) throws BadLocationException [Inherited From AbstractDocument]
  Returns a position that will track change as the document is altered.
public void dump (PrintStream out) [Inherited From AbstractDocument]
  Gives a diagnostic dump.
protected void fireChangedUpdate (DocumentEvent e) [Inherited From AbstractDocument]
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireInsertUpdate (DocumentEvent e) [Inherited From AbstractDocument]
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireRemoveUpdate (DocumentEvent e) [Inherited From AbstractDocument]
  Notifies all listeners that have registered interest for notification on this event type.
protected void fireUndoableEditUpdate (UndoableEditEvent e) [Inherited From AbstractDocument]
  Notifies all listeners that have registered interest for notification on this event type.
public int getAsynchronousLoadPriority () [Inherited From AbstractDocument]
  Gets the asynchronous loading priority.
protectedfinal AttributeContext getAttributeContext () [Inherited From AbstractDocument]
  Fetches the context for managing attributes.
public Element getBidiRootElement () [Inherited From AbstractDocument]
  Returns the root element of the bidirectional structure for this document.
protectedfinal Content getContent () [Inherited From AbstractDocument]
  Gets the content for the document.
protectedfinalsynchronized Thread getCurrentWriter () [Inherited From AbstractDocument]
  Fetches the current writing thread if there is one.
public Element getDefaultRootElement () [Specified in AbstractDocument]
  Gets the default root element for the document model.
public DocumentFilter getDocumentFilter () [Inherited From AbstractDocument]
  Returns the DocumentFilter that is responsible for filtering of insertion/removal.
public DocumentListener getDocumentListeners () [Inherited From AbstractDocument]
  Returns an array of all the document listeners registered on this document.
public Dictionary<Object, Object> getDocumentProperties () [Inherited From AbstractDocument]
  Supports managing a set of properties.
publicfinal Position getEndPosition () [Inherited From AbstractDocument]
  Returns a position that represents the end of the document.
public int getLength () [Inherited From AbstractDocument]
  Returns the length of the data.
public T getListeners (Class< T> listenerType) [Inherited From AbstractDocument]
  Returns an array of all the objects currently registered as FooListeners upon this document.
public Element getParagraphElement (int pos) [Specified in AbstractDocument]
  Get the paragraph element containing the given position.
publicfinal Object getProperty (Object key) [Inherited From AbstractDocument]
  A convenience method for looking up a property value.
public Element getRootElements () [Inherited From AbstractDocument]
  Gets all root elements defined.
publicfinal Position getStartPosition () [Inherited From AbstractDocument]
  Returns a position that represents the start of the document.
public String getText (int offset, int length) throws BadLocationException [Inherited From AbstractDocument]
  Gets a sequence of text from the document.
public void getText (int offset, int length, Segment txt) throws BadLocationException [Inherited From AbstractDocument]
  Fetches the text contained within the given portion of the document.
public UndoableEditListener getUndoableEditListeners () [Inherited From AbstractDocument]
  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 [Inherited From AbstractDocument]
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 [Inherited From AbstractDocument]
  Performs the actual work of the remove.
public void insertString (int offs, String str, AttributeSet a) throws BadLocationException [Overrides AbstractDocument]
  Inserts some content into the document.
protected void insertUpdate (DefaultDocumentEvent chng, AttributeSet attr) [Overrides AbstractDocument]
  Updates document structure as a result of text insertion.
pack-private boolean isLeftToRight (int p0, int p1) [Inherited From AbstractDocument]
Returns true if the text in the range p0 to p1 is left to right.
protected void postRemoveUpdate (DefaultDocumentEvent chng) [Inherited From AbstractDocument]
  Updates any document structure as a result of text removal.
publicfinal void putProperty (Object key, Object value) [Inherited From AbstractDocument]
  A convenience method for storing up a property value.
publicfinalsynchronized void readLock () [Inherited From AbstractDocument]
  Acquires a lock to begin reading some state from the document.
publicfinalsynchronized void readUnlock () [Inherited From AbstractDocument]
  Does a read unlock.
public void remove (int offs, int len) throws BadLocationException [Inherited From AbstractDocument]
  Removes some content from the document.
public void removeDocumentListener (DocumentListener listener) [Inherited From AbstractDocument]
  Removes a document listener.
public void removeUndoableEditListener (UndoableEditListener listener) [Inherited From AbstractDocument]
  Removes an undo listener.
protected void removeUpdate (DefaultDocumentEvent chng) [Overrides AbstractDocument]
  Updates any document structure as a result of text removal.
public void render (Runnable r) [Inherited From AbstractDocument]
  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 [Inherited From AbstractDocument]
  Deletes the region of text from offset to offset + length, and replaces it with text.
public void setAsynchronousLoadPriority (int p) [Inherited From AbstractDocument]
  Sets the asynchronous loading priority.
public void setDocumentFilter (DocumentFilter filter) [Inherited From AbstractDocument]
  Sets the DocumentFilter.
public void setDocumentProperties (Dictionary<Object, Object> x) [Inherited From AbstractDocument]
  Replaces the document properties dictionary for this document.
pack-private void updateBidi (DefaultDocumentEvent chng) [Inherited From AbstractDocument]
  Update the bidi element structure as a result of the given change to the document.
protectedfinalsynchronized void writeLock () [Inherited From AbstractDocument]
  Acquires a lock to begin mutating the document this lock protects.
protectedfinalsynchronized void writeUnlock () [Inherited From AbstractDocument]
  Releases a write lock previously obtained via writeLock.
Fields
Hide/Show inherited fields
pack-privatefinalstatic String AsyncLoadPriority = "load priority" [Inherited From AbstractDocument]
Document property that indicates asynchronous loading is desired, with the thread priority given as the value.
protectedfinalstatic String BAD_LOCATION = "document location failure" [Inherited From AbstractDocument]
Error message to indicate a bad location.
publicfinalstatic String BidiElementName = "bidi level" [Inherited From AbstractDocument]
Name of elements used to hold a unidirectional run
publicfinalstatic String ContentElementName = "content" [Inherited From AbstractDocument]
Name of elements used to represent content
publicfinalstatic String ElementNameAttribute = "$ename" [Inherited From AbstractDocument]
Name of the attribute used to specify element names.
pack-privatefinalstatic String I18NProperty = "i18n" [Inherited From AbstractDocument]
  Document property that indicates whether internationalization functions such as text reordering or reshaping should be performed.
publicfinalstatic String lineLimitAttribute = "lineLimit"
  Name of the attribute that specifies the maximum length of a line, if there is a maximum length.
protected EventListenerList listenerList [Inherited From AbstractDocument]
The event listener list for the document.
pack-privatefinalstatic Object MultiByteProperty [Inherited From AbstractDocument]
  Document property that indicates if a character has been inserted into the document that is more than one byte long.
publicfinalstatic String ParagraphElementName = "paragraph" [Inherited From AbstractDocument]
Name of elements used to represent paragraphs
publicfinalstatic String SectionElementName = "section" [Inherited From AbstractDocument]
Name of elements used to hold sections (lines/paragraphs).
publicfinalstatic String tabSizeAttribute = "tabSize"
  Name of the attribute that specifies the tab size for tabs contained in the content.
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