showContextMenu method

void showContextMenu(
  1. Object contextmenu, [
  2. GraphObject? obj
])

Show an Adornment or HTMLInfo as a context menu.

This method is called by the context click (Tool#doMouseDown) and CommandHandler#showContextMenu. If you want to programmatically show a context menu for a particular GraphObject or for the whole diagram, do not call this method, which only does one small piece of the process of bringing up a context menu. Instead call CommandHandler#showContextMenu, which will start this tool and eventually call this method and handle additional input events.

For Adornment context menus: If the object's containing Part is data-bound, this sets the contextmenu's Part.data to the same value. The Adornment#adornedObject property is set to the GraphObject for which the menu is being shown.

This method sets the #currentContextMenu.

This method may be overridden. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {Adornment|HTMLInfo} contextmenu @param {GraphObject} obj the GraphObject for which the context menu is being shown; this is null if the contextmenu is being shown for the diagram background.

Implementation

void showContextMenu(
  _i2.Object contextmenu, [
  _i3.GraphObject? obj,
]) {
  _i4.callMethod(
    this,
    'showContextMenu',
    [
      contextmenu,
      obj ?? _i5.undefined,
    ],
  );
}