Console Tree Menu Items

These menu items only display when a node is selected. The following example is for a console tree menu item:

public XYZ extends CTreeNode {
  public Component[] getActionMenuItems() {
    return (new Component[] { editorsMenu});
  }
}

In general, there are predefined menu positions defined in the Console interface:

  public static final int ID_FILE_MENU = 0;
  public static final int ID_EDIT_MENU = 1;
  public static final int ID_VIEW_MENU = 2;
  public static final int ID_ACTIONS_MENU = 10;
  public static final int ID_TOOLS_MENU = 20;
  public static final int ID_WIZARD_MENU = 30;
  public static final int ID_WINDOW_MENU = 90;
  public static final int ID_HELP_MENU = 99;

If the CMenu item’s (that is returned from the above example) position matches with one of the predefined ones, then that CMenu item’s submenus are merged in else that CMenu is inserted based on the position. So if the CMenu has a position of ID_ACTIONS_MENU, then the items are merged in to the action menu item that is already on the main menubar. If the CMenu has a position (ID_ACTIONS_MENU - 1), then the CMenu is inserted before the action menu.