C

PopoverManager

A utility class that manages popovers described by PopoverDescriptor instances.
Implements
Inheritance Hierarchy

Remarks

The ToolTipInputMode and ContextMenuInputMode use the same installed GraphInputMode.popoverManager to manage tooltips and popovers. Because tooltips use PopoverBehavior.HINT and the context-menu PopoverBehavior.AUTO, one of each can be shown at the same time.

To open your own popovers, you can either call open on the installed GraphInputMode.popoverManager to integrated with popovers from other modes (note the different PopoverBehaviors), or add another PopoverManager to the GraphInputMode.

See Also

Developer's Guide

API

ToolTipInputMode, PopoverDescriptor, open

Members

Show:

Constructors

Parameters

Properties

Gets the installed controller.
protectedreadonlyfinal
Gets or sets a custom parent element to which the popover is added as a child in the DOM.

By default, this property is null, which means that the popover is added to the CanvasComponent.overlayPanel.

If the CanvasComponent is contained in a shadow DOM, the popover is always added to the CanvasComponent.overlayPanel to ensure that it is contained inside the shadow DOM.

When specifying some other element as parent, it must be assured that the element is currently visible (i.e., has no style with property display: none).

This property acts as the default value for the PopoverDescriptor.parentElement property. So it can also be set specifically for each popover descriptor.

final

See Also

API
parentElement
Gets or sets the enabled state of this input mode.
Clients can use this property to disable or reenable this instance. This will set the ConcurrencyController.enabled property of the installed controller.
Gets whether any descriptor is currently open.
readonlyfinal
Gets an IEnumerable<T> collection of all currently active popover descriptors.
Active popover descriptors are instances of PopoverDescriptor that are currently being managed and have not been closed or removed. Note that this is a live view. Do not modify the open popovers while iterating it.
readonlyfinal

See Also

Developer's Guide
API
isOpen
Gets the IInputModeContext this mode has been installed in.
The value will be null if this mode is currently not installed. Use createInputModeContext to obtain a context that has this IInputMode as the IInputModeContext.inputMode.
protectedreadonlyfinal
Gets the priority of this input mode.
The priority will influence the order in which the modes will be installed into the CanvasComponent. The lower the priority value, the earlier it will be installed. If two modes are using the same priority value, the first one to be registered will be installed earlier.
final

Methods

Will be called to unconditionally cancel all ongoing edits.

This will be called prior to the uninstalling of this instance and when other input modes temporarily acquire the mutex.

In order to stop an active input mode manually, client code should use the following idiom:

if (!mode.tryStop()) {
  mode.cancel()
}
Immediately closes all popovers.
Creates an IInputModeContext for use with the PopoverDescriptor.update event.
Adjust the calculated popover position.
This method moves the popover into the document bounds if the content would otherwise be (partially) outside.
protected

Parameters

descriptor: PopoverDescriptor
The popover descriptor for which the location is calculated.
pageLocation: Point
The calculated popover position relative to the document root.

Return Value

Point
The adjusted location relative to the document root.
Installs this mode into the given context that is provided by the canvas.

In general a mode can only be installed into a single canvas at all times.

This method is called to initialize this instance. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.

Overriding implementations should call the base implementation first.

final

Parameters

context: IInputModeContext
The context that this instance shall be installed into. The same instance will be passed to this instance during IInputMode.uninstall. A reference to the context may be kept and queried during the time the mode is installed.
controller: ConcurrencyController
The controller for this mode.

See Also

API
uninstall
Called after cancel has been called.

Can be overridden in subclasses to perform additional actions after the mode has been canceled.

This implementation closes all popovers.

protected
Called after the ConcurrencyController.active property of the installed ConcurrencyController has been set to true.

Can be overridden in subclasses to perform additional actions after the mode has been activated.

Overriding implementations should invoke the base implementation.

protected
Called after the ConcurrencyController.active property of the installed ConcurrencyController has been set to false.

Can be overridden in subclasses to perform additional actions after the mode has been deactivated.

Overriding implementations should invoke the base implementation.

protected
Called after tryStop has been called.

Can be overridden in subclasses to perform additional actions after the mode has been stopped.

This implementation closes all popovers.

protected
Opens a popover with the behavior configured by the specified descriptor.
Depending on the PopoverDescriptor.behavior, other popovers may be closed implicitly when the new popover shows.

Parameters

descriptor: PopoverDescriptor
The PopoverDescriptor that describes the properties and content of the popover to display.

Return Value

Promise<boolean>
A Promise that represents the asynchronous operation. The task result is true if the popover was successfully opened; otherwise, false.

Throws

Exception ({ name: 'InvalidOperationError' })
Thrown if the PopoverManager is not installed on a canvas.

See Also

Developer's Guide
Overridden to only return true if this instance does not currently have the input mutex.

Return Value

boolean
true iff this instance does not own the mutex.
Uninstalls this mode from the given context.

This code should clean up all changes made to the canvas in the IInputMode.install method. After a mode has been uninstalled, it can be installed again into the same or another canvas.

Overriding implementations should call the base implementation after their own code.

Parameters

context: IInputModeContext
The context to deregister from. This is the same instance that had been passed to IInputMode.install during installation.