This is an abstract contextmenu class. The various behaviors of the user-customized contextmenu can be encapsulated in its subclasses, and then its subclasses should be created in the XViewerUI::createContextMenu to complete the contextmenu customization..
More...
|
| destroy () |
| Override this method to implement the destruction logic of contextmenu component.
|
|
| disable () |
| Override this method to implement the logical to make contextmenu component unusable.
|
|
| enable () |
| Override this method to implement the logical to make contextmenu component usable.
|
|
| getCurrentTarget () |
| Obtains current target object for menu items. More...
|
|
| setCurrentTarget (target) |
| Set a target object when the right-click menu is displayed, and the menu item can get the target object for some operations. More...
|
|
| showAt (x, y) |
| Override this method to implement the logical to display the contextmenu at specific position which relative to the top left of the fully rendered content area in the browser. More...
|
|
| addDestroyHook (...hooks) |
| Add a function to destroyHooks list, which will be called during destroy. More...
|
|
| destroy () |
|
| ownsTo (owner) |
| Establishes an ownership relationship where this instance will be destroyed when the owner is destroyed. Additionally, the owner will be automatically removed from the destroyHooks list when this instance is destroyed. More...
|
|
This is an abstract contextmenu class. The various behaviors of the user-customized contextmenu can be encapsulated in its subclasses, and then its subclasses should be created in the XViewerUI::createContextMenu to complete the contextmenu customization.
.
◆ getCurrentTarget()
IContextMenu::getCurrentTarget |
( |
| ) |
|
|
inline |
Obtains current target object for menu items.
- Returns
- any
◆ setCurrentTarget()
IContextMenu::setCurrentTarget |
( |
|
target | ) |
|
|
inline |
Set a target object when the right-click menu is displayed, and the menu item can get the target object for some operations.
- Parameters
-
◆ showAt()
IContextMenu::showAt |
( |
|
x, |
|
|
|
y |
|
) |
| |
|
inline |
Override this method to implement the logical to display the contextmenu at specific position which relative to the top left of the fully rendered content area in the browser.
- Parameters
-
pageX | number - |
pageY | number - |
- Returns
- boolean - True indicates that the custom context menu is displayed and the built-in menu does not need to be displayed. False indicates that the custom menu is not displayed and the built-in menu needs to be displayed.