Eclipse Platform
Release 3.0

org.eclipse.jface.text
Class Document

java.lang.Object
  extended byorg.eclipse.jface.text.AbstractDocument
      extended byorg.eclipse.jface.text.Document
All Implemented Interfaces:
IDocument, IDocumentExtension, IDocumentExtension2, IDocumentExtension3, IRepairableDocument

public class Document
extends AbstractDocument

Default document implementation. Uses a GapTextStoreas default text store and a SequentialRewriteTextStorewhen in sequential rewrite mode.

The used line tracker considers the following strings as line delimiters "\n", "\r", "\r\n".

The document is ready to use. It has a default position category for which a default position updater is installed.

See Also:
GapTextStore, SequentialRewriteTextStore

Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.text.IDocumentExtension
IDocumentExtension.IReplace
 
Field Summary
 
Fields inherited from interface org.eclipse.jface.text.IDocument
DEFAULT_CATEGORY, DEFAULT_CONTENT_TYPE
 
Fields inherited from interface org.eclipse.jface.text.IDocumentExtension3
DEFAULT_PARTITIONING
 
Constructor Summary
Document()
          Creates a new empty document.
Document(String initialContent)
          Creates a new document with the given initial content.
 
Method Summary
 void startSequentialRewrite(boolean normalized)
          Tells the document that it is about to be sequentially rewritten.
 void stopSequentialRewrite()
          Tells the document that the sequential rewrite has been finished.
 
Methods inherited from class org.eclipse.jface.text.AbstractDocument
acceptPostNotificationReplaces, addDocumentListener, addDocumentPartitioningListener, addPosition, addPosition, addPositionCategory, addPositionUpdater, addPrenotifiedDocumentListener, completeInitialization, computeIndexInCategory, computeIndexInPositionList, computeNumberOfLines, computePartitioning, computePartitioning, containsPosition, containsPositionCategory, doFireDocumentChanged, doFireDocumentChanged, doFireDocumentChanged2, fireDocumentAboutToBeChanged, fireDocumentChanged, fireDocumentPartitioningChanged, fireDocumentPartitioningChanged, fireDocumentPartitioningChanged, get, get, getChar, getContentType, getContentType, getDocumentListeners, getDocumentManagedPositions, getDocumentPartitioner, getDocumentPartitioner, getDocumentPartitioningListeners, getLegalContentTypes, getLegalContentTypes, getLegalLineDelimiters, getLength, getLineDelimiter, getLineInformation, getLineInformationOfOffset, getLineLength, getLineOffset, getLineOfOffset, getNumberOfLines, getNumberOfLines, getPartition, getPartition, getPartitionings, getPositionCategories, getPositions, getPositionUpdaters, getStore, getTracker, ignorePostNotificationReplaces, insertPositionUpdater, registerPostNotificationReplace, removeDocumentListener, removeDocumentPartitioningListener, removePosition, removePosition, removePositionCategory, removePositionUpdater, removePrenotifiedDocumentListener, repairLineInformation, replace, resumeListenerNotification, resumePostNotificationProcessing, search, set, setDocumentPartitioner, setDocumentPartitioner, setLineTracker, setTextStore, stopListenerNotification, stopPostNotificationProcessing, updateDocumentStructures, updatePositions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Creates a new empty document.


Document

public Document(String initialContent)
Creates a new document with the given initial content.

Parameters:
initialContent - the document's initial content
Method Detail

startSequentialRewrite

public void startSequentialRewrite(boolean normalized)
Description copied from interface: IDocumentExtension
Tells the document that it is about to be sequentially rewritten. That is a sequence of non-overlapping replace operations will be performed on it. The normalize flag indicates whether the rewrite is performed from the start of the document to its end or from an arbitrary start offset.

The document is considered being in sequential rewrite mode as long as stopSequentialRewrite has not been called.

Specified by:
startSequentialRewrite in interface IDocumentExtension
Overrides:
startSequentialRewrite in class AbstractDocument

stopSequentialRewrite

public void stopSequentialRewrite()
Description copied from interface: IDocumentExtension
Tells the document that the sequential rewrite has been finished. This method has only any effect if startSequentialRewrite has been called before.

Specified by:
stopSequentialRewrite in interface IDocumentExtension
Overrides:
stopSequentialRewrite in class AbstractDocument

Eclipse Platform
Release 3.0

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.