AnnotationsUI (comments/annotations)



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:



  • 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.


  • 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 annotations UI is responsible for reacting to its changes.


    uiAnnotations : AnnotationCollection
  • detach()

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

  • setActiveAnnotation( annotation )

    Sets or unsets the active annotation.

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


    annotation : Annotation | null