ContextMenuProvider

The ContextMenuProvider allows applications to create their own context menus. The context menus are always defined on a view. To allow this, entry CONTEXT_MENUS is always available for each view, together with the ROOTUIELEMENTCONTAINER. Here, you can define your required context menu at runtime.

This menu is assigned to view elements as follows. Each view element has three options:

  • It inherits the context menu from its parent (in the containment hierarchy).
  • It hides its context menu.
  • It provides a context menu (defined in the view).

These three cases are expressed in the property ContextMenuProvider Properties.

A "provider" sets property ContextMenuProvider Properties to the ID of its menu. To do this you need these two new properties in each (potential) provider. A provider can be:

  • Each UI element subclass
  • Several selected view element subclasses (TableColumn, Tab, etc)

Each UI element subclass is now automatically a (potential) provider. For the relevant view element subclasses the inheritance hierarchy has been changed so that it inherits from the ContextMenuProvider instead of from the ViewElement.

Example of the Visual Display

Display in the Application Display in View Designer

Runtime Class

CL_WD_CTX_MENU_PROVIDER

Properties in View Designer

Name Type Initial Value Bindable

Methods and Properties of UI Elements

STRING

(automatic)

No

ContextMenuProvider Properties

WDUI_CONTEXT_MENU_BEHAVIOUR

inherit

No

ContextMenuProvider Properties

STRING

No

Dynamic Programming

For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. But note that the spelling format and use of upper/lower case is different.

Dynamic Programming of Properties

View Designer Name Runtime Name Type

ContextMenuProvider Properties

CONTEXT_MENU_BEHAVIOUR

WDUI_CONTEXT_MENU_BEHAVIOUR

 contextMenuBehaviour: inherit

CL_WD_CTX_MENU_PROVIDER=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT

 contextMenuBehaviour: provide

CL_WD_CTX_MENU_PROVIDER=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE

 contextMenuBehaviour: suppress

CL_WD_CTX_MENU_PROVIDER=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS

ContextMenuProvider Properties

CONTEXT_MENU_ID

STRING