Package org.eclipse.compare
Interface IEditableContent
-
- All Known Implementing Classes:
DocumentRangeNode,ResourceNode,StructureRootNode
public interface IEditableContentCommon interface for objects with editable contents. Typically it is implemented by objects that also implement theIStreamContentAccessorinterface.Clients may implement this interface.
Note that implementing
IEditableContentdoes not automatically mean that it is editable. An object is only editable if it implementsIEditableContentand theisEditablemethod returnstrue.- See Also:
IStreamContentAccessor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisEditable()Returnstrueif this object can be modified.ITypedElementreplace(ITypedElement dest, ITypedElement src)This method is called on a parent to add or remove a child, or to copy the contents of a child.voidsetContent(byte[] newContent)Replaces the current content with the given new bytes.
-
-
-
Method Detail
-
isEditable
boolean isEditable()
Returnstrueif this object can be modified. If it returnsfalsethe other methods of this API must not be called.- Returns:
trueif this object can be modified
-
setContent
void setContent(byte[] newContent)
Replaces the current content with the given new bytes.- Parameters:
newContent- this new contents replaces the old contents
-
replace
ITypedElement replace(ITypedElement dest, ITypedElement src)
This method is called on a parent to add or remove a child, or to copy the contents of a child. What to do is encoded in the two arguments as follows:add: dest == null src != null remove: dest != null src == null copy: dest != null src != null - Parameters:
dest- the existing child of this object to be replaced; ifnulla new child can be added.src- the new child to be added or replaced; ifnullan existing child can be removed.- Returns:
- the argument
dest
-
-