Eclipse Platform
2.1

org.eclipse.jface.text
Class ChildDocumentManager

java.lang.Object
  |
  +--org.eclipse.jface.text.ChildDocumentManager
All Implemented Interfaces:
IDocumentListener, ISlaveDocumentManager

public final class ChildDocumentManager
extends Object
implements IDocumentListener, ISlaveDocumentManager

Manages a set of child documents for given parent documents. A child document represents a particular range of the parent document and is accordingly adapted to changes of the parent document. Vice versa, the parent document is accordingly adapted to changes of its child documents. The manager does not maintain any particular management structure but utilizes mechanisms given by IDocument such as position categories and position updaters.

For internal use only.


Field Summary
static String CHILDDOCUMENTS
          Name of the position categories used to keep track of the child documents offset ranges into the parent document.
 
Constructor Summary
ChildDocumentManager()
           
 
Method Summary
 IDocumentInformationMapping createMasterSlaveMapping(IDocument slave)
          Creates a new mapping between the given slave document and its master.
 IDocument createSlaveDocument(IDocument master)
          Creates a new slave document for the given master document.
 void documentAboutToBeChanged(DocumentEvent event)
          The manipulation described by the document event will be performed.
 void documentChanged(DocumentEvent event)
          The manipulation described by the document event has been performed.
protected  void fireDocumentEvent(boolean about, DocumentEvent event)
          Informs all child documents of the document which issued this document event.
 void freeSlaveDocument(IDocument slave)
          Frees the given slave document.
protected  IPositionUpdater getChildPositionUpdater()
          Returns the child position updater.
 IDocument getMasterDocument(IDocument slave)
          Returns the master of the given slave document.
 boolean isSlaveDocument(IDocument document)
          Method isSlaveDocument.
 void setAutoExpandMode(IDocument slaveDocument, boolean autoExpand)
          Sets the given document's auto expand mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHILDDOCUMENTS

public static final String CHILDDOCUMENTS
Name of the position categories used to keep track of the child documents offset ranges into the parent document.

See Also:
Constant Field Values
Constructor Detail

ChildDocumentManager

public ChildDocumentManager()
Method Detail

getChildPositionUpdater

protected IPositionUpdater getChildPositionUpdater()
Returns the child position updater. If necessary, it is dynamically created.

Returns:
the child position updater

createSlaveDocument

public IDocument createSlaveDocument(IDocument master)
Description copied from interface: ISlaveDocumentManager
Creates a new slave document for the given master document.

Specified by:
createSlaveDocument in interface ISlaveDocumentManager
Parameters:
master -
Returns:
IDocument

freeSlaveDocument

public void freeSlaveDocument(IDocument slave)
Description copied from interface: ISlaveDocumentManager
Frees the given slave document.

Specified by:
freeSlaveDocument in interface ISlaveDocumentManager
Parameters:
slave -

createMasterSlaveMapping

public IDocumentInformationMapping createMasterSlaveMapping(IDocument slave)
Description copied from interface: ISlaveDocumentManager
Creates a new mapping between the given slave document and its master.

Specified by:
createMasterSlaveMapping in interface ISlaveDocumentManager
Returns:
IDocumentInformationMapping

getMasterDocument

public IDocument getMasterDocument(IDocument slave)
Description copied from interface: ISlaveDocumentManager
Returns the master of the given slave document.

Specified by:
getMasterDocument in interface ISlaveDocumentManager
Parameters:
slave -
Returns:
IDocument

isSlaveDocument

public boolean isSlaveDocument(IDocument document)
Description copied from interface: ISlaveDocumentManager
Method isSlaveDocument.

Specified by:
isSlaveDocument in interface ISlaveDocumentManager
Parameters:
document -
Returns:
boolean

fireDocumentEvent

protected void fireDocumentEvent(boolean about,
                                 DocumentEvent event)
Informs all child documents of the document which issued this document event.

Parameters:
about - indicates whether the change is about to happen or alread happend
event - the document event which will be processed to inform child documents

documentChanged

public void documentChanged(DocumentEvent event)
Description copied from interface: IDocumentListener
The manipulation described by the document event has been performed.

Specified by:
documentChanged in interface IDocumentListener
Parameters:
event - the document event describing the document change

documentAboutToBeChanged

public void documentAboutToBeChanged(DocumentEvent event)
Description copied from interface: IDocumentListener
The manipulation described by the document event will be performed.

Specified by:
documentAboutToBeChanged in interface IDocumentListener
Parameters:
event - the document event describing the document change

setAutoExpandMode

public void setAutoExpandMode(IDocument slaveDocument,
                              boolean autoExpand)
Description copied from interface: ISlaveDocumentManager
Sets the given document's auto expand mode. In auto expand mode, a slave is expanded to include all of the master document affected by document changes.

Specified by:
setAutoExpandMode in interface ISlaveDocumentManager
Parameters:
slaveDocument - the slave whose auto expand mode should be set
autoExpand - the mode

Eclipse Platform
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.