|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public ContextMenu
This interface defines Context Menu operations.
Method Summary | |
---|---|
Boolean |
registerContextMenu(String contextMenuId,
ContextMenuLoader contextMenuLoader)
Register a context menu loader at a particular id that will be used to load items when requested by the getContextMenu or getContextMenuDeferred functions using the registered id. |
String |
addContribution(String contextMenuId,
ContextMenuLoader contributionLoader,
Number ordinal)
Adds a contribution to a context menu with the given contextMenuId. |
ContextMenuLoader |
removeContribution(String contextMenuId,
String id)
Removes a contribution from a context menu with the given contextMenuId by the id that uniquely identifies that contribution within the particular context menu. |
ContextMenuLoader[] |
getContributions(String contextMenuId)
Gets an array of all the contributions that have been added to a context menu with the given contextMenuId. |
Object |
registerListener(String contextMenuId,
Object scope,
Function func)
Register a listener function which will be fired whenever a particular context menu identified by the contextMenuId is updated. |
Object |
registerListener(String contextMenuId,
Function func)
Register a listener function which will be fired whenever a particular context menu identified by the contextMenuId is updated. |
void |
unregisterListener(Object handle)
Unregisters a previously registered listener to a context menu's onChange event. |
Method Detail |
---|
Boolean registerContextMenu(String contextMenuId, ContextMenuLoader contextMenuLoader)
getContextMenu
or getContextMenuDeferred
functions using the registered id. A default loader will be used if nothing has been registered with a particular contextMenuId when requested. This function replaces any existing context menu loader that was registered to the same contextMenuId. Registering a null
context menu loader will effectively remove any existing loader that is already registered to the same contextMenuId.
contextMenuId
-
id of menu to retrieve contributions from. Must not be null
.contextMenuLoader
-
contextMenuLoader to be register to a particular id. May be null
.
String addContribution(String contextMenuId, ContextMenuLoader contributionLoader, Number ordinal)
contextMenuId
-
id of menu to contribute to. Must not be null
.contributionLoader
-
contribution to add to the menu.ordinal
-
Optional value used for relative ordering with the base items and other contributions.null
if the contribution was null
. This id may be used to remove the contribution later via the removeContribution function.ContextMenuLoader removeContribution(String contextMenuId, String id)
contextMenuId
-
id of menu remove the contribution from. Must not be null
.id
-
id of contribution to remove from the menu.
null
if no match was foundContextMenuLoader[] getContributions(String contextMenuId)
contextMenuId
-
id of menu to retrieve contributions from. Must not be null
.
null
.Object registerListener(String contextMenuId, Object scope, Function func)
contextMenuId
-
id of the context menu to which to register the listener. Must not be null
.scope
-
scope in which the function will be invoked when the event is fired. May be null
to default to global scope.func
-
function to be called whenever the context menu is changed. May be the function reference itself, or the String name of the function on the scope object. Must not be null
.function(contextMenuId)
{
}
String contextMenuId
id of the context menu that was updatedObject registerListener(String contextMenuId, Function func)
contextMenuId
-
id of the context menu to which to register the listener. Must not be null
.func
-
function to be called whenever the context menu is changed. May be the function reference itself, or the String name of the function in the global scope. Must not be null
.function(contextMenuId)
{
}
String contextMenuId
id of the context menu that was updatedvoid unregisterListener(Object handle)
handle
-
connection handle that was returned by a call to registerListener
. Must not be null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |