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.
|
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
public DynamicTreeMenuType()
public DynamicTreeMenuType(java.lang.String[][] menu, java.lang.String menuType)
menu
- The list of menus and their associated actions.menuType
- The name of this DynamicTreeMenuType.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.
str
- The array of String arrays.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)
menu
field which is a list of menu items and associated actions.newMenu
- The list of menu items and associated actions.public void setMenuType(java.lang.String newMenuType)
newMenuType
- The new name of this DynamicTreeMenuType.