Package com.sun.javatest.exec
Class JavaTestMenuManager
java.lang.Object
com.sun.javatest.exec.JavaTestMenuManager
Class to manage custom menus. This class allows the test suite architect to
add various custom menu items to designated places in the menu system of the
Test Manager. The constants in this class represent those designated
positions and are semantic locations, not absolute. This allows
reorganization of menus at the harness level without necessarily breaking
the positioning that the architect expected.
This class can be used in two ways. First, the concrete class overrides
getMenuItems()
to return the correct set of items for the given
category. This method may be the most simple for straight forward insertions.
The second method is to use addMenuItem()
to sequentially
specify which menu items should appear. The default implementation of
getMenuItems()
will use data provided by using this second
method.
By default, no menu category will have any custom menus (getMenuItems()
will always return null).
The JMenuItem
objects may be "pull-right" menus if desired. It is
the responsibility of the architect to manage keystroke mnemonics.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addMenuItem
(int position, JMenuItem item) Add a menu item to the given menu position.getMenuItems
(int position) Get the menu items to go into the specified position in the menu system.
-
Field Details
-
FILE_PRIMARY
public static final int FILE_PRIMARY- See Also:
-
FILE_OTHER
public static final int FILE_OTHER- See Also:
-
CONFIG_PRIMARY
public static final int CONFIG_PRIMARY- See Also:
-
CONFIG_VIEW
public static final int CONFIG_VIEW- See Also:
-
CONFIG_OTHER
public static final int CONFIG_OTHER- See Also:
-
RUN_PRIMARY
public static final int RUN_PRIMARY- See Also:
-
RUN_OTHER
public static final int RUN_OTHER- See Also:
-
WINDOWS_MAIN
public static final int WINDOWS_MAIN- See Also:
-
PRESENTATION
public static final int PRESENTATION- See Also:
-
PREFERENCES
public static final int PREFERENCES- See Also:
-
LOG_VIEW
public static final int LOG_VIEW- See Also:
-
LOG_CONFIG
public static final int LOG_CONFIG- See Also:
-
HELP_PRIMARY
public static final int HELP_PRIMARY- See Also:
-
HELP_TESTSUITE
public static final int HELP_TESTSUITE- See Also:
-
HELP_ABOUT
public static final int HELP_ABOUT- See Also:
-
TOOLS_OTHER
public static final int TOOLS_OTHER- See Also:
-
-
Constructor Details
-
JavaTestMenuManager
public JavaTestMenuManager()
-
-
Method Details
-
getMenuItems
Get the menu items to go into the specified position in the menu system. See the constants in this class for the possible value.- Parameters:
position
- The menu position, one of the constants of this class.- Returns:
- The custom menu items to be displayed in the given position. Null if there are none. Never a zero-length array.
- Throws:
IllegalArgumentException
- If the position parameter is out of range. This is usually the fault of the harness itself, but may occur if classes are compiled against one development version of the harness and run with another.
-
addMenuItem
Add a menu item to the given menu position. The item is added to the bottom, in that position, so you must add them in the order you wish them to appear.- Parameters:
position
- The menu position, one of the constants of this class.item
- The menu item to add.- Throws:
IndexOutOfBoundsException
- If the position index is out of range. Be sure that you are using the constants given in this class to supply this parameter.
-