|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.sync.doc.DocumentChangeMessage
public class DocumentChangeMessage
Document change message of communicating document change events to remote models.
Constructor Summary | |
---|---|
DocumentChangeMessage(int offset,
int length,
java.lang.String text)
Create document change message for given offset, length of replacement, and text to replace. |
Method Summary | |
---|---|
void |
applyToModel(java.lang.Object model)
Apply the change to a model. |
static DocumentChangeMessage |
deserialize(byte[] bytes)
|
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
int |
getLengthOfInsertedText()
|
int |
getLengthOfReplacedText()
Returns the length of replaced text. |
int |
getOffset()
Returns the modification index of the operation resembled by this message. |
java.lang.String |
getText()
Get the new text. |
byte[] |
serialize()
Serialize the current message |
void |
setLengthOfReplacedText(int length)
|
void |
setOffset(int updatedOffset)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DocumentChangeMessage(int offset, int length, java.lang.String text)
offset
- the offset (number of characters) in the document where change is to occur.length
- the length (number of characters) that are to be replace in existing document.text
- the text to actually replace.Method Detail |
---|
public static DocumentChangeMessage deserialize(byte[] bytes) throws SerializationException
SerializationException
public int getOffset()
getOffset
in interface IDocumentChange
public void setOffset(int updatedOffset)
public int getLengthOfReplacedText()
getLengthOfReplacedText
in interface IDocumentChange
public void setLengthOfReplacedText(int length)
public java.lang.String getText()
IDocumentChange
getText
in interface IDocumentChange
public int getLengthOfInsertedText()
public java.lang.String toString()
toString
in class java.lang.Object
public byte[] serialize() throws SerializationException
serialize
in interface IModelChangeMessage
SerializationException
- if this model change message
cannot be serialized.public java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
public void applyToModel(java.lang.Object model) throws ModelUpdateException
IModelChange
applyToModel
in interface IModelChange
model
- the model to apply this change to. Must not be null
.
Should be of type appropriate to the model.
ModelUpdateException
- thrown if model is null
, of incorrect
type, or cannot be changed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |