com.ibm.mashups.builder.model
Interface ContextMenu


public ContextMenu

This interface defines Context Menu operations.


Method Summary
 JSON[] getContextMenu(String contextMenuId, String targetResourceId, String targetResourceType, Object someObject)
           Returns a array of JSON objects for a given collection of menu choices for the selected context menu.
 Deferred getContextMenuDeferred(String contextMenuId, String targetResourceId, String targetResourceType, Object someObject)
           Returns a deferred object that loads an array of JSON objects for a given collection of menu choices for the selected context menu.
 

Method Detail

getContextMenu

JSON[] getContextMenu(String contextMenuId,
                      String targetResourceId,
                      String targetResourceType,
                      Object someObject)
Returns a array of JSON objects for a given collection of menu choices for the selected context menu.
Each object in the array follows the  ContextMenuItem object format plus any custom extension properties that a context menu may define.

Parameters:
contextMenuId - this is id of the context menu. Examples: ContextMenu.page, ContextMenu.space, ContextMenu.toolbox, ContextMenu.modeSelector ContextMenu.widgetSkin, or any additional extension. Must not be null.
targetResourceId - this is the ID of the resource to associate the decision for this menu choice with. This will be passed into the respective contextmenu functions and must not be null.
targetResourceType - this is the resource type of the resource to associate the decision for this menu choice with. This will be passed into the respective contextmenu functions. May be null. Possible values for this could be "com.ibm.mashups.enabler.space.SpaceNode", "com.ibm.mashups.iwidget.widget.IWidgetDefinition", "com.ibm.mashups.enabler.navigation.NavigationNode", or any other type used by an extension.
someObject - this allows an arbitrary object to be passed into the context menu items' functions in case they need additional data for making the decisions.
Returns:
A JSON object array of menu choices; may be an empty array if no choices exist for that context menu, but never null.

getContextMenuDeferred

Deferred getContextMenuDeferred(String contextMenuId,
                                String targetResourceId,
                                String targetResourceType,
                                Object someObject)
Returns a deferred object that loads an array of JSON objects for a given collection of menu choices for the selected context menu. Its callback will receive this array as its first argument in asynchronous mode, and the deferred's start function will return the array directly in synchronous mode.
Each object in the array follows the  ContextMenuItem object format plus any custom extension properties that a context menu may define.

Parameters:
contextMenuId - this is id of the context menu. Examples: ContextMenu.page, ContextMenu.space, ContextMenu.toolbox, ContextMenu.modeSelector ContextMenu.widgetSkin, or any additional extension. Must not be null.
targetResourceId - this is the ID of the resource to associate the decision for this menu choice with. This will be passed into the respective contextmenu functions and must not be null.
targetResourceType - this is the resource type of the resource to associate the decision for this menu choice with. This will be passed into the respective contextmenu functions. May be null. Possible values for this could be "com.ibm.mashups.enabler.space.SpaceNode", "com.ibm.mashups.iwidget.widget.IWidgetDefinition", "com.ibm.mashups.enabler.navigation.NavigationNode", or any other type used by an extension.
someObject - this allows an arbitrary object to be passed into the context menu items' functions in case they need additional data for making the decisions.
Returns:
A deferred object used to start this operation, never null. The return value when executed through the deferred object is A JSON object array of menu choices; may be an empty array if no choices exist for that context menu, but never null. The deferred supports synchronous and asynchronous operations.


Copyright IBM Corp. 2010 All Rights Reserved.