java.lang.Object | |
↳ | com.microstrategy.web.app.gui.ContextMenu |
A ContextMenu
is displayed when the end user makes click
using the right mouse button on an
element in the interface; the menu displays a list with
different actions associated with that element.
A ContextMenu
is basically a collection of ContextMenuItem
objects.
Each ContextMenuItem
represents a single option to the end user.
Context menus can and should be configured using external xml files. All Microstrategy Web
transforms that display context-menus have their
contextMenus
formal parameter assigned in the style catalog. Even those transforms that display no
context menus out of the box can be configured to display them simply by creating a new
xml definition file and setting the contextMenus
formal parameter.
Optionally, a ContextMenu
can be populated programatically using one of the
several addItem
methods it exposes. Once populated, the ContextMenu
should be attached to the corresponding HTML tag by calling the attachTo(Tag)
method
or by appending the necessary attributes returned by the getTriggerString()
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | ContextMenu.DefaultContextMenuItemBuilder | This class is the default implementation of a ContextMenuItemBuilder . |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ATT_FOR_CONTEXT_MENU_INDICES | ||||||||||
String | ATT_FOR_CONTEXT_MENU_MANAGER_ID | ||||||||||
int | TRIGGER_ITEM | From the attributes necessary to trigger the display of the ContextMenu ,
this represents the id of this context-menu. |
|||||||||
int | TRIGGER_MENU | From the attributes necessary to trigger the display of the ContextMenu ,
this represents the name of the ContextMenuManager . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ContextMenuItem |
addItem(String name)
This method is deprecated.
this method may cause context menus to break due to an optimization that finds duplicated menu items, please use
addItem(ContextMenuItem)
| ||||||||||
ContextMenuItem |
addItem(String name, String jsSubmitFunction, String jsParameters)
Adds a new
ContextMenuItem with the given name and sets its action to be to execute
the given javascript function using the corresponding parameters. | ||||||||||
ContextMenuItem |
addItem(String name, String url)
Adds a new
ContextMenuItem with the given name and sets its action to be to open
the given URL. | ||||||||||
ContextMenuItem |
addItem(ContextMenuItem item)
Adds an existing
ContextMenuItem instance to the list of options available
in this ContextMenu . | ||||||||||
ContextMenuItem |
addItem(String name, ContextMenu submenu)
Adds a new
ContextMenuItem with the given name, and sets the given
ContextMenu as its subMenu; this sub-menu will automatically
be displayed when the item is selected. | ||||||||||
void |
addSeparator()
Adds a new separator item to the
ContextMenu . | ||||||||||
void |
addTagAttributes(Map<String, String> atts)
Adds to the given
Map (name/value pairs) all attributes required
in an HTML Tag to trigger the display of the context-menu. | ||||||||||
void |
addTagAttributes(Map<String, String> atts, int infoFlag)
Appends to the given Map those attributes required
in an HTML Tag to trigger the display of the context-menu.
| ||||||||||
void |
attachTo(Tag tag)
Appends to the HTML
Tag all those attributes required
to trigger the display of the context-menu. | ||||||||||
void |
attachTo(Tag tag, int infoFlag)
Appends to the HTML
Tag those attributes required
to trigger the display of the context-menu. | ||||||||||
static Map<String, String> | getEmptyTagAttributes() | ||||||||||
String |
getKey()
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
| ||||||||||
String |
getManagerName()
Returns the name of the Context Menu Manager to whom this ContextMenu is
associated.
| ||||||||||
String | getMenuIndicesAttribute() | ||||||||||
int |
getMenuSize()
Returns the number of current menu-items in this context-menu.
| ||||||||||
String |
getName()
Returns the name of this
ContextMenu . | ||||||||||
Map<String, String> |
getTagAttributes()
Returns a
Map (name/value pairs) of all attributes required
to append into an HTML Tag to trigger the display of the context-menu. | ||||||||||
Map<String, String> |
getTagAttributes(int infoFlag)
Returns a
Map (name/value pairs) of those attributes required
to append into an HTML Tag to trigger the display of the context-menu. | ||||||||||
MarkupOutput |
getTriggerOutput()
This method is deprecated.
Use
getTriggerString()
| ||||||||||
String |
getTriggerString()
Returns a
String object with all the attributes that should be used inside
an HTML tag to trigger the display of the context-menu. | ||||||||||
String |
getTriggerString(int infoFlag)
Returns a
String object with those attributes that should be used inside
an HTML tag to trigger the display of the context-menu. | ||||||||||
void |
setManagerName(String newValue)
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
| ||||||||||
void |
setName(String name)
This method is deprecated.
The name of the
ContextMenu should be provided as part of the constructor. | ||||||||||
void |
startGroup()
After calling this method, this
ContextMenu will append a separator
when a new ContextMenuItem is added. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getID()
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
| ||||||||||
int |
getParentID()
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
| ||||||||||
void |
setID(int ID)
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
| ||||||||||
void |
setParentID(int parentID)
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
From the attributes necessary to trigger the display of the ContextMenu
,
this represents the id of this context-menu.
From the attributes necessary to trigger the display of the ContextMenu
,
this represents the name of the ContextMenuManager
.
This method is deprecated.
this method may cause context menus to break due to an optimization that finds duplicated menu items, please use addItem(ContextMenuItem)
Adds a new ContextMenuItem
with the specified name to the ContextMenu.
name | Name of the new ContextMenuItem to be added. |
---|
ContextMenuItem
instance added.Adds a new ContextMenuItem
with the given name and sets its action to be to execute
the given javascript function using the corresponding parameters. It is equivalent to:
ContextMenuItem item = new ContextMenuItem(name); item.setJSCode(jsSubmitFunction + "(" + jsParameters + ");"); addItem(item);
name | name of the new item to be added |
---|---|
jsSubmitFunction | Name of the javascript function to execute |
jsParameters | String with the list of the paramters required by the javascript function. |
Adds a new ContextMenuItem
with the given name and sets its action to be to open
the given URL. It is equivalent to:
ContextMenuItem item = new ContextMenuItem(name); item.setURL(url); addItem(item);
name | name of the new item to be added. |
---|---|
url | URL to be associatied with the item. If the Item is clicked by the user, she will be redirected to such location. |
ContextMenuItem
instance added.
Adds an existing ContextMenuItem
instance to the list of options available
in this ContextMenu
.
item | The ContextMenuItem to be added. |
---|
ContextMenuItem
Adds a new ContextMenuItem
with the given name, and sets the given
ContextMenu
as its subMenu; this sub-menu will automatically
be displayed when the item is selected. This method is equivalent to calling:
ContextMenuItem item = new ContextMenuItem(name); item.setSubMenu(submenu); addItem(item);
name | name of the new item to be added. |
---|---|
submenu | ContextMenu containing the submenu items of the
current ContextMenu. |
Adds a new separator item to the ContextMenu
. A separator is identified in the
collection of ContextMenuItem
children as those whose name is "-".
Adds to the given Map
(name/value pairs) all attributes required
in an HTML Tag to trigger the display of the context-menu.
Appends to the given Map those attributes required
in an HTML Tag to trigger the display of the context-menu.
The infoFlag
parameter receives a flagged enumeration specifying what information should
be included. Possible values:
Appends to the HTML Tag
all those attributes required
to trigger the display of the context-menu.
Appends to the HTML Tag
those attributes required
to trigger the display of the context-menu.
The infoFlag
parameter receives a flagged enumeration specifying what information should
be included. Possible values:
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
Returns a String
with the key identifier of this ContextMenu.
Returns the name of the Context Menu Manager to whom this ContextMenu is associated.
Returns the number of current menu-items in this context-menu.
Returns the name of this ContextMenu
.
Returns a Map
(name/value pairs) of all attributes required
to append into an HTML Tag to trigger the display of the context-menu.
Returns a Map
(name/value pairs) of those attributes required
to append into an HTML Tag to trigger the display of the context-menu.
The infoFlag
parameter receives a flagged enumeration specifying what information should
be included. Possible values:
This method is deprecated.
Use getTriggerString()
Returns a new MarkupOutput
object with the attributes that should be used inside
an HTML tag to trigger the display of the context-menu.
Returns a String
object with all the attributes that should be used inside
an HTML tag to trigger the display of the context-menu.
Returns a String
object with those attributes that should be used inside
an HTML tag to trigger the display of the context-menu.
The infoFlag
parameter receives a flagged enumeration specifying what information should
be included. Possible values:
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
Sets the name of the Context Menu Manager.
This method is deprecated.
The name of the ContextMenu
should be provided as part of the constructor.
Sets the name of this ContextMenu
.
After calling this method, this ContextMenu
will append a separator
when a new ContextMenuItem
is added.
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
Returns the ID of this ContextMenu
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
For those ContextMenu
objects that are actually submenus, return the ID
of their parent ContextMenu
.
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
Sets the id of this menu.
This method is deprecated.
This method should only be used internally. It will be marked as private in future versions.
Used by those ContextMenu
objects which are actually submenus, to know
the ID of their parent menu.