Class GSContextMenuMixin
A mixin class providing context menu functionality.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Creates a new instance of
GSContextMenuMixin |
| Method Attributes | Method Name and Description |
|---|---|
|
addContextMenuItem(menuItem)
Adds a context menu item for this component.
|
|
|
addContextMenuItemAt(menuItem, pos)
Adds a context menu item for this component at the specified position.
|
|
|
Disables this component's context menu
|
|
|
Enables this component's context menu if it has been set
|
|
|
Returns the context menu for this component
|
|
|
Removes this component's context menu
|
|
|
removeContextMenuItem(menuItem)
Removes the passed in context menu item from the list of menu items dynamically
added by this component to its context menu
|
|
|
setContextMenu(contextMenu)
Sets the context menu for this component
|
Method Detail
addContextMenuItem(menuItem)
Adds a context menu item for this component. The menu item will be dynamically
added to the context menu set on the component when it is displayed.
When the context menu is closed the menu item will be automatically removed.
Requires that a context menu has first been set for this component.
- Parameters:
- {GSMenuItem} menuItem
- the menu item to set
- Throws:
- {Error}
- if an attempt is made to add a context menu item before a context menu has been set
addContextMenuItemAt(menuItem, pos)
Adds a context menu item for this component at the specified position.
The menu item will be dynamically added to the context menu set on the component
when the context menu is displayed.
When the context menu is closed the menu item will be automatically removed.
Requires that a context menu has first been set for this component.
- Parameters:
- {GSMenuItem} menuItem
- the menu item to set
- {int} pos
- the position that the menu item will be added to in the context menu
- Throws:
- {Error}
- if an attempt is made to add a context menu item before a context menu has been set
disableContextMenu()
Disables this component's context menu
{GSContextMenu}
enableContextMenu()
Enables this component's context menu if it has been set
- Returns:
- {GSContextMenu} the context menu belonging to this component
{GSContextMenu}
getContextMenu()
Returns the context menu for this component
- Returns:
- {GSContextMenu} the compoonents's context menu
{GSContextMenu}
removeContextMenu()
Removes this component's context menu
- Returns:
- {GSContextMenu} the context menu that was removed, or
nullif no context menu was set
{boolean}
removeContextMenuItem(menuItem)
Removes the passed in context menu item from the list of menu items dynamically
added by this component to its context menu
- Parameters:
- {GSMenuItem} menuItem
- the menu item to remove
- Returns:
- {boolean}
trueif the menu item was removed from the component's list of menu items,falseif the menu item was not contained in the list
setContextMenu(contextMenu)
Sets the context menu for this component
- Parameters:
- {GSContextMenu} contextMenu
- the context menu to display in response to right-click events on this component