MarkerOperation
Abstract base operation class.
Properties
affectedSelectable : ModelSelectablereadonlymodule:engine/model/operation/markeroperation~MarkerOperation#affectedSelectableA selectable that will be affected by the operation after it is executed.
The exact returned parameter differs between operation types.
affectsData : booleanreadonlymodule:engine/model/operation/markeroperation~MarkerOperation#affectsDataSpecifies whether the marker operation affects the data produced by the data pipeline (is persisted in the editor's data).
baseVersion : null | numberinheritedmodule:engine/model/operation/markeroperation~MarkerOperation#baseVersionversionon which operation can be applied. If you try to apply operation with different base version than the document version the model-document-applyOperation-wrong-version error is thrown.module:engine/model/operation/markeroperation~MarkerOperation#batchBatch to which the operation is added or
nullif the operation is not added to any batch yet.Note, that a non-document operation has this property always set to
null, and is never added to any batch.isDocumentOperation : booleanreadonlyinheritedmodule:engine/model/operation/markeroperation~MarkerOperation#isDocumentOperationDefines whether operation is executed on attached or detached items.
name : stringreadonlymodule:engine/model/operation/markeroperation~MarkerOperation#nameMarker name.
newRange : null | ModelRangereadonlymodule:engine/model/operation/markeroperation~MarkerOperation#newRangeMarker range after the change.
oldRange : null | ModelRangereadonlymodule:engine/model/operation/markeroperation~MarkerOperation#oldRangeMarker range before the change.
type : 'marker'readonlymodule:engine/model/operation/markeroperation~MarkerOperation#typeOperation type.
_markers : MarkerCollectionprivatereadonlymodule:engine/model/operation/markeroperation~MarkerOperation#_markersMarker collection on which change should be executed.
Static properties
className : stringreadonlystaticmodule:engine/model/operation/markeroperation~MarkerOperation.classNameName of the operation class used for serialization.
Methods
constructor( name, oldRange, newRange, markers, affectsData, baseVersion )module:engine/model/operation/markeroperation~MarkerOperation#constructorParameters
name : stringMarker name.
oldRange : null | ModelRangeMarker range before the change.
newRange : null | ModelRangeMarker range after the change.
markers : MarkerCollectionMarker collection on which change should be executed.
affectsData : booleanSpecifies whether the marker operation affects the data produced by the data pipeline (is persisted in the editor's data).
baseVersion : null | numberDocument
versionon which operation can be applied ornullif the operation operates on detached (non-document) tree.
clone() → MarkerOperationmodule:engine/model/operation/markeroperation~MarkerOperation#cloneCreates and returns an operation that has the same parameters as this operation.
Returns
getReversed() → Operationmodule:engine/model/operation/markeroperation~MarkerOperation#getReversedtoJSON() → unknownmodule:engine/model/operation/markeroperation~MarkerOperation#toJSONCustom toJSON method to solve child-parent circular dependencies.
Returns
unknownClone of this object with the operation property replaced with string.
_execute() → voidinternalmodule:engine/model/operation/markeroperation~MarkerOperation#_executeExecutes the operation - modifications described by the operation properties will be applied to the model tree.
Returns
void
_validate() → voidinternalinheritedmodule:engine/model/operation/markeroperation~MarkerOperation#_validateChecks whether the operation's parameters are correct and the operation can be correctly executed. Throws an error if operation is not valid.
Returns
void
Static methods
fromJSON( json, document ) → MarkerOperationstaticmodule:engine/model/operation/markeroperation~MarkerOperation.fromJSONCreates
MarkerOperationobject from deserialized object, i.e. from parsed JSON string.Parameters
json : anyDeserialized JSON object.
document : ModelDocumentDocument on which this operation will be applied.
Returns