public class ProjectionDocumentManager extends Object implements IDocumentListener, ISlaveDocumentManager, ISlaveDocumentManagerExtension
ProjectionDocumentManager is one particular implementation
of ISlaveDocumentManager. This manager
creates so called projection documents (see
ProjectionDocumentas slave
documents for given master documents.
A projection document represents a particular projection of the master
document and is accordingly adapted to changes of the master document. Vice
versa, the master document is accordingly adapted to changes of its slave
documents. The manager does not maintain any particular management structure
but utilizes mechanisms given by IDocument
such as position categories and position updaters.
Clients can instantiate this class. This class is not intended to be subclassed.
| Constructor and Description |
|---|
ProjectionDocumentManager() |
| Modifier and Type | Method and Description |
|---|---|
IDocumentInformationMapping |
createMasterSlaveMapping(IDocument slave)
Creates a new document information mapping between the given slave document and
its master document.
|
protected ProjectionDocument |
createProjectionDocument(IDocument master)
Factory method for projection documents.
|
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 masterEvent)
Informs all projection documents of the master document that issued the given document event.
|
void |
freeSlaveDocument(IDocument slave)
Frees the given slave document.
|
IDocument |
getMasterDocument(IDocument slave)
Returns the master document of the given slave document or
null if the
given document is unknown to this slave document manager. |
IDocument[] |
getSlaveDocuments(IDocument master)
Returns the list of slave documents for the given master document or
null if there are no such slave document. |
boolean |
isSlaveDocument(IDocument document)
Returns whether the given document is a slave document known to this slave document manager.
|
void |
setAutoExpandMode(IDocument slave,
boolean autoExpanding)
Sets the given slave document's auto expand mode.
|
protected void fireDocumentEvent(boolean about,
DocumentEvent masterEvent)
about - indicates whether the change is about to happen or happened alreadymasterEvent - the document event which will be processed to inform the projection documentspublic void documentChanged(DocumentEvent event)
IDocumentListenerdocumentChanged in interface IDocumentListenerevent - the document event describing the document changepublic void documentAboutToBeChanged(DocumentEvent event)
IDocumentListenerdocumentAboutToBeChanged in interface IDocumentListenerevent - the document event describing the document changepublic IDocumentInformationMapping createMasterSlaveMapping(IDocument slave)
ISlaveDocumentManagernull if the given document is unknown
to this slave document manager.createMasterSlaveMapping in interface ISlaveDocumentManagerslave - the slave documentnullpublic IDocument createSlaveDocument(IDocument master)
ISlaveDocumentManagerfreeSlaveDocument
is called. The connection between the newly created slave document and the master
document is managed by this slave document manager.createSlaveDocument in interface ISlaveDocumentManagermaster - the master documentISlaveDocumentManager.freeSlaveDocument(IDocument)protected ProjectionDocument createProjectionDocument(IDocument master)
master - the master documentpublic void freeSlaveDocument(IDocument slave)
ISlaveDocumentManagercreateSlaveDocument.freeSlaveDocument in interface ISlaveDocumentManagerslave - the slave document to be freedISlaveDocumentManager.createSlaveDocument(IDocument)public IDocument getMasterDocument(IDocument slave)
ISlaveDocumentManagernull if the
given document is unknown to this slave document manager.getMasterDocument in interface ISlaveDocumentManagerslave - the slave documentnullpublic boolean isSlaveDocument(IDocument document)
ISlaveDocumentManagerisSlaveDocument in interface ISlaveDocumentManagerdocument - the document to be checked whether it is a slave document known to this managertrue if the document is a slave document, false otherwisepublic void setAutoExpandMode(IDocument slave, boolean autoExpanding)
ISlaveDocumentManagerThis call is without effect if the given document is unknown to this slave document manager.
setAutoExpandMode in interface ISlaveDocumentManagerslave - the slave whose auto expand mode should be setautoExpanding - true for auto expand, false otherwisepublic IDocument[] getSlaveDocuments(IDocument master)
ISlaveDocumentManagerExtensionnull if there are no such slave document.getSlaveDocuments in interface ISlaveDocumentManagerExtensionmaster - the master documentnullGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.