/* (non-Javadoc)
* @see org.eclipse.ecf.sync.IModelChange#applyToModel(java.lang.Object)
*/
public void applyToModel(Object model) throws ModelUpdateException {
if (model == null) throw new ModelUpdateException("Model cannot be null",this,null);
if (model instanceof IDocument) {
try {
((IDocument) model).replace(getOffset(), getLengthOfReplacedText(), getText());
} catch (BadLocationException e) {
throw new ModelUpdateException("Exception applying change to document",this,model);
}
} else throw new ModelUpdateException("Incorrect type of model to apply change",this,model);
}