com.novell.application.console.snapin
Interface MenuSnapin

All Superinterfaces:
Snapin
All Known Implementing Classes:
AbstractToolBarMenuSnapin, SnapinMenuFileNew

public interface MenuSnapin
extends Snapin

Provides a menu to snap into the main menu of the shell.

Snap-ins must implement this interface to provide menu items to be shown in the main menu of the shell. The top and first level of the main menu can have an insertion point where all later menus that snap into that menu will come in. If the developer is creating a menu snap-in that will be in one of these locations and wants to define this insertion point, use a JMenuItem with the text equal to Shell.MENU_INSERTION_POINT. If this is not defined, all pop-up menu items snapped in later will come in at the bottom.

To provide a menu to be shown in a context menu of a specific object in the tree you must implement the PopupMenuSnapin interface.

See Also:
PopupMenuSnapin

Method Summary
 javax.swing.JMenuItem[] getMenuItems()
          Returns an array of JMenuItems.
 java.lang.String getMenuLocation()
          Returns the location of the snap-in menu item in the main menu hierarchy.
 
Methods inherited from interface com.novell.application.console.snapin.Snapin
getSnapinDescription, getSnapinName, initSnapin, shutdownSnapin
 

Method Detail

getMenuItems

public javax.swing.JMenuItem[] getMenuItems()
Returns an array of JMenuItems.

The JMenuItems will be displayed in the main menu of the shell. Menus in ConsoleOne have locale-independant key names that are referred to in the getMenuLocation() method to define what menu to snap into. These keys are defined as the ‘action command’ of the menu. When defining menus that will be snapped into, set the action command of the menu, using the setActionCommand() method, to be the key that other developers can use to register against. For ConsoleOne, the console snapin's main menu uses the English menu name as the key.

Returns:
JMenuItems to be added to the main menu.

getMenuLocation

public java.lang.String getMenuLocation()
Returns the location of the snap-in menu item in the main menu hierarchy.

If the ancestors returned do not exist, they are created. If they do exist, the new menu item is inserted at the snap-in point of insertion. Menus in ConsoleOne have locale-independant key names that are referred to in the getMenuLocation() method to define what menu to snap into. These keys are defined as the ‘action command’ of the menu. For ConsoleOne, the console snapin's main menu uses the English menu name as the key.

To place items in nested menus, use the % as a separator. For example, to snap into the File/New submenu, return "File%New" from the getMenuLocation() method.

Note: For ConsoleOne menu items, you should always return the English menu names, even if you are adding menu items to a localized version of ConsoleOne. If you return localized menu names, they will appear as new (duplicate) menu items in the shell.

Returns:
The location of the snap-in menu item in the main menu hierarchy.


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.