com.ibm.mashups.builder.model
Interface ContextMenuLoader


public ContextMenuLoader

This object is used to retrieve context menu items by returning a  Deferred object that returns those items either directly in synchronous mode or via the callback in asynchronous mode. The items returned by the  Deferred must be an array of items that follow the  ContextMenuItem format.


Method Summary
 com.ibm.mashups.enabler.Deferred getItems(String contextMenuId, String targetResourceId, String targetResourceType, Object someObject)
           Returns aDeferred object that will pass an array of the items loaded by this object as the first argument to the callback.
 void onChange()
           Event that notifies the system that this loader's contents have changed and may be reloaded to avoid stale data.
 

Method Detail

getItems

com.ibm.mashups.enabler.Deferred getItems(String contextMenuId,
                                          String targetResourceId,
                                          String targetResourceType,
                                          Object someObject)
Returns aDeferred object that will pass an array of the items loaded by this object as the first argument to the callback.

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. Must not be null.
targetResourceType - this is the resource type of the resource to associate the decision for this menu choice with. 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 loader in case it needs additional data for making the decisions.
Returns:
Deferred object that loads the data and fires the callback with an array of items conforming to theContextMenuItem format that are retrieved by this loader; never null.

onChange

void onChange()
Event that notifies the system that this loader's contents have changed and may be reloaded to avoid stale data. Callers may call this function on a loader that has been registered to a particular context menu id or used as a contribution to an existing context menu. The system listens to this event in order to notify any registered listeners on a context menu of the event.



Copyright IBM Corp. 2010 All Rights Reserved.