API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. Document View Source
Author(s)
Timothy Prinzing
Since
Version
1.44 11/17/05
Serial
Hierarchy
 Document
Subinterfaces
Description
public interface Document
  The Document is a container for text that serves as the model for swing text components.
Methods
Hide/Show inherited methods
public void addDocumentListener (DocumentListener listener)
  Registers the given observer to begin receiving notifications when changes are made to the document.
public void addUndoableEditListener (UndoableEditListener listener)
  Registers the given observer to begin receiving notifications when undoable edits are made to the document.
public Position createPosition (int offs) throws BadLocationException
  This method allows an application to mark a place in a sequence of character content.
public Element getDefaultRootElement ()
  Returns the root element that views should be based upon, unless some other mechanism for assigning views to element structures is provided.
public Position getEndPosition ()
  Returns a position that represents the end of the document.
public int getLength ()
  Returns number of characters of content currently in the document.
public Object getProperty (Object key)
  Gets the properties associated with the document.
public Element getRootElements ()
  Returns all of the root elements that are defined.
public Position getStartPosition ()
  Returns a position that represents the start of the document.
public String getText (int offset, int length) throws BadLocationException
  Fetches the text contained within the given portion of the document.
public void getText (int offset, int length, Segment txt) throws BadLocationException
  Fetches the text contained within the given portion of the document.
public void insertString (int offset, String str, AttributeSet a) throws BadLocationException
  Inserts a string of content.
public void putProperty (Object key, Object value)
  Associates a property with the document.
public void remove (int offs, int len) throws BadLocationException
  Removes a portion of the content of the document.
public void removeDocumentListener (DocumentListener listener)
  Unregisters the given observer from the notification list so it will no longer receive change updates.
public void removeUndoableEditListener (UndoableEditListener listener)
  Unregisters the given observer from the notification list so it will no longer receive updates.
public void render (Runnable r)
  Allows the model to be safely rendered in the presence of concurrency, if the model supports being updated asynchronously.
Fields
Hide/Show inherited fields
publicfinalstatic String StreamDescriptionProperty = "stream"
  The property name for the description of the stream used to initialize the document.
publicfinalstatic String TitleProperty = "title"
The property name for the title of the document, if there is one.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar