Interface

AnnotationsUI (comments/annotations)

@ckeditor/ckeditor5-comments/src/annotations/annotationsuis

interface

An interface for the annotations UI plugin class.

The annotations UI class handles displaying, focusing, activating and hiding annotations views.

The annotations UI class must be a plugin, so it has to extend the Plugin or ContextPlugin class.

Examples of AnnotationsUI are:

Filtering

Properties

  • activeAnnotation : Annotation | null

    Observable activeAnnotation property. AnnotationsUIs listens to changes on that property.

    To make this property observable use this.set( 'activeAnnotation', null ) in the constructor.

Methods

  • attach( uiAnnotations )

    Creates everything needed for the UI and attaches all listeners. This method is called when the UI is activated.

    The observable collection of annotation is passed as the first argument, and the annotation UI is responsible for reacting to its changes.

    Parameters

    uiAnnotations : AnnotationCollection
  • detach()

    Destroys the UI and removes all listeners. This method is called when the UI is deactivated.

  • setActiveAnnotation( annotation )

    Sets or unsets active annotation.

    This method should set the AnnotationsUI#activeAnnotation property. It also should set Annotation#isActive of the deactivated and the activated annotation.

    Parameters

    annotation : Annotation | null