Internal
Fires an module:engine/model/markercollection~MarkerCollection#event:update event for the given ~Marker marker but does not change the marker. Useful to force module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast conversion for the marker.
Marker or name of a marker to refresh.
Internal
Removes given ~Marker marker or a marker with given name from the MarkerCollection.
Marker or name of a marker to remove.
true if marker was found and removed, false otherwise.
Internal
Creates and adds a ~Marker marker to the MarkerCollection with given name on given
module:engine/model/range~ModelRange range.
If MarkerCollection already had a marker with given name (or ~Marker marker was passed), the marker in
collection is updated and module:engine/model/markercollection~MarkerCollection#event:update event is fired
but only if there was a change (marker range or module:engine/model/markercollection~Marker#managedUsingOperations
flag has changed.
Name of marker to set or marker instance to update.
Marker range.
OptionalmanagedUsingOperations: boolean
Specifies whether the marker is managed using operations.
OptionalaffectsData: boolean
Specifies whether the marker affects the data produced by the data pipeline (is persisted in the editor's data).
Marker instance which was added or updated.
Iterable interface.
Iterates over all ~Marker markers added to the collection.
Destroys marker collection and all markers inside it.
Returns ~Marker marker with given markerName.
Name of marker to get.
Marker with given name or null if such marker was
not added to the collection.
Returns iterator that iterates over all markers, which ranges contain given module:engine/model/position~ModelPosition position.
Iterates over all markers that starts with given prefix.
const markerFooA = markersCollection._set( 'foo:a', rangeFooA );
const markerFooB = markersCollection._set( 'foo:b', rangeFooB );
const markerBarA = markersCollection._set( 'bar:a', rangeBarA );
const markerFooBarA = markersCollection._set( 'foobar:a', rangeFooBarA );
Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
Returns iterator that iterates over all markers, which intersects with given module:engine/model/range~ModelRange range.
Checks if given ~Marker marker or marker name is in the collection.
Name of marker or marker instance to check.
true if marker is in the collection, false otherwise.
The collection of all module:engine/model/markercollection~Marker markers attached to the document. It lets you module:engine/model/markercollection~MarkerCollection#get get markers or track them using module:engine/model/markercollection~MarkerCollection#event:update event.
To create, change or remove makers use module:engine/model/writer~ModelWriter model writers' methods: module:engine/model/writer~ModelWriter#addMarker or module:engine/model/writer~ModelWriter#removeMarker. Since the writer is the only proper way to change the data model it is not possible to change markers directly using this collection. All markers created by the writer will be automatically added to this collection.
By default there is one marker collection available as module:engine/model/model~Model#markers model property.
See
module:engine/model/markercollection~Marker