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

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • 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. Used to create new Strings for the array of String arrays referenced as a parameter 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:
        the list of menu items and their associated actions.
      • getMenuType

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

        public void menuToJS(java.lang.StringBuffer sb,
                             int i)
        Converts the list of menu items to JavaScript.
      • 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.