public class DynamicTreeMenuType
extends java.lang.Object
A DynamicTreeNode can define its own menus or it can specify a menuType. If the DynamicTreeNode.menuType is set, a matching DynamicTreeMenuType must be set. When a match is found, the menu items and their corresponding actions are assigned to the DynamicTreeNode in JavaScript. When the node is selected, and if menus are enabled, the context menu will appear and be populated with data from the matching DynamicTreeMenuType.
If no matching DynamicTreeMenuType exists for a DynamicTreeNode, the DynamicTreeNode must supply its own menus. Or an error message will be displayed when the user attempts to display the context menu.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
protected java.lang.String[][] | menu
Defines the menu items and their associated actions.
|
protected java.lang.String | menuType
Defines the name of the DynamicTreeMenuType.
|
Constructor and Description |
---|
DynamicTreeMenuType()
Default constructor.
|
DynamicTreeMenuType(java.lang.String[][] menu, java.lang.String menuType)
Creates a DynamicTreeMenuType, loading it with a name and menu array.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[][] | copyStringArray(java.lang.String[][] str)
Copies an array of String arrays into a new array of String arrays.
|
java.lang.String[][] | getMenu()
Returns the list of menu items and their associated actions.
|
java.lang.String | getMenuType()
Returns the name of this DynamicTreeMenuType
|
void | menuToJS(java.lang.StringBuffer sb, int i)
Converts the list of menu items to JavaScript.
|
void | setMenu(java.lang.String[][] newMenu)
Sets the menu field which is a list of menu items and associated actions.
|
void | setMenuType(java.lang.String newMenuType)
Sets the name of this DynamicTreeMenuType.
|
public static final java.lang.String COPYRIGHT
protected java.lang.String menuType
protected java.lang.String[][] menu
Each array should consist of two values.
First, the national language enabled menu name, which will be displayed to the user.
Second, the action, in the form of a fully qualified URL, which will be launched when the user selects this menu item. If associated DynamicTreeNode.contextMenuParams is set, this value will be appended to the action by adding the following: "?" + node.contextMenuParams
An array with empty quotes yields a separator line in the context menu.
For example:
{ {"Open", "http://www.ibm.com"},
{"", ""},
{"Copy", "http://www.ibm.com/copyAction"} }
public DynamicTreeMenuType()
public DynamicTreeMenuType(java.lang.String[][] menu, java.lang.String menuType)
public java.lang.String[][] copyStringArray(java.lang.String[][] str)
Typically used by the constructor. Used to create new Strings for the array of String arrays referenced as a parameter to create a fresh copy of the Strings.
public java.lang.String[][] getMenu()
public java.lang.String getMenuType()
public void menuToJS(java.lang.StringBuffer sb, int i)
public void setMenu(java.lang.String[][] newMenu)
public void setMenuType(java.lang.String newMenuType)