public class ProjectionDocumentEvent extends SlaveDocumentEvent
ProjectionDocumentwhen it is
manipulated. The manipulation is either a content manipulation or a change of
the projection between the master and the slave. Clients can determine the
type of change by asking the projection document event for its change type
(see getChangeType()) and comparing it with the predefined types
PROJECTION_CHANGEand CONTENT_CHANGE.
Clients are not supposed to create instances of this class. Instances are
created by ProjectionDocument
instances. This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
static Object |
CONTENT_CHANGE
The change type indicating a content change
|
static Object |
PROJECTION_CHANGE
The change type indicating a projection change
|
fDocument, fLength, fModificationStamp, fOffset, fText| Constructor and Description |
|---|
ProjectionDocumentEvent(IDocument doc,
int offset,
int length,
String text,
DocumentEvent masterEvent)
Creates a new content change event caused by the given master document
change.
|
ProjectionDocumentEvent(IDocument doc,
int offset,
int length,
String text,
int masterOffset,
int masterLength)
Creates a new projection change event for the given properties.
|
ProjectionDocumentEvent(IDocument doc,
int offset,
int length,
String text,
int masterOffset,
int masterLength,
DocumentEvent masterEvent)
Creates a new projection document event for the given properties.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getChangeType()
Returns the change type of this event.
|
int |
getMasterLength()
Returns the length of the master document range that has been added or removed in case this event
describes a projection changed, otherwise
-1. |
int |
getMasterOffset()
Returns the offset of the master document range that has been added or removed in case this
event describes a projection change, otherwise it returns
-1. |
getMasterEventgetDocument, getLength, getModificationStamp, getOffset, getTextpublic static final Object PROJECTION_CHANGE
public static final Object CONTENT_CHANGE
public ProjectionDocumentEvent(IDocument doc, int offset, int length, String text, DocumentEvent masterEvent)
-1
when calling getMasterOffset or
getMasterLength. This information can be obtained by
accessing the master event.doc - the changed projection documentoffset - the offset in the projection documentlength - the length in the projection documenttext - the replacement textmasterEvent - the original master eventpublic ProjectionDocumentEvent(IDocument doc, int offset, int length, String text, int masterOffset, int masterLength)
doc - the projection documentoffset - the offset in the projection documentlength - the length in the projection documenttext - the replacement textmasterOffset - the offset in the master documentmasterLength - the length in the master documentpublic ProjectionDocumentEvent(IDocument doc, int offset, int length, String text, int masterOffset, int masterLength, DocumentEvent masterEvent)
doc - the projection documentoffset - the offset in the projection documentlength - the length in the projection documenttext - the replacement textmasterOffset - the offset in the master documentmasterLength - the length in the master documentmasterEvent - the master document eventpublic Object getChangeType()
PROJECTION_CHANGE or
CONTENT_CHANGE.public int getMasterOffset()
-1.-1public int getMasterLength()
-1.-1Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.