com.ibm.commerce.tools.common.ui
Class DynamicTreeMenuType

java.lang.Object
  |
  +--com.ibm.commerce.tools.common.ui.DynamicTreeMenuType

public class DynamicTreeMenuType
extends java.lang.Object

Creates an menu type to be matched in DynamicTreeNode.menuType.

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 n 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.


Field Summary
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 Summary
DynamicTreeMenuType()
          Default constructor.
DynamicTreeMenuType(java.lang.String[][] menu, java.lang.String menuType)
          Creates a DynamicTreeMenuType, loading it with a name and menu array.
 
Method Summary
 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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menu

protected java.lang.String[][] menu
Defines the menu items and their associated actions.

Each array should consist of two values.

First, the NLS 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 seperator line in the context menu.

For example:
{ {"Open", "http://www.ibm.com"},
{"", ""},
{"Copy", "http://www.ibm.com/copyAction"} }


menuType

protected java.lang.String menuType
Defines the name of the DynamicTreeMenuType.
See Also:
DynamicTreeNode.menuType
Constructor Detail

DynamicTreeMenuType

public DynamicTreeMenuType()
Default constructor.

DynamicTreeMenuType

public DynamicTreeMenuType(java.lang.String[][] menu,
                           java.lang.String menuType)
Creates a DynamicTreeMenuType, loading it with a name and menu array.
Parameters:
menu - The list of menus and their associated actions.
menuType - The name of this DynamicTreeMenuType.
Method Detail

copyStringArray

public java.lang.String[][] copyStringArray(java.lang.String[][] str)
Copies an array of String arrays into a new array of String arrays.

Typically used by the constructor to create new Strings for the array of String arrays refernced as a parameter. argument to create a fresh copy of the Strings.

Parameters:
str - The array of String arrays.
Returns:
The newly created array of String arrays.

getMenu

public java.lang.String[][] getMenu()
Returns the list of menu items and their associated actions.
Returns:
java.lang.String[][]

getMenuType

public java.lang.String getMenuType()
Returns the name of this DynamicTreeMenuType
Returns:
java.lang.String

setMenu

public void setMenu(java.lang.String[][] newMenu)
Sets the menu field which is a list of menu items and associated actions.
Parameters:
newMenu - The list of menu items and associated actions.

setMenuType

public void setMenuType(java.lang.String newMenuType)
Sets the name of this DynamicTreeMenuType.
Parameters:
newMenuType - The new name of this DynamicTreeMenuType.