com.cleancode.swing
Class JMenuSpec

java.lang.Object
  extended by com.cleancode.swing.JMenuSpec

public class JMenuSpec
extends Object

A specification for a JMenuSpec used as a component of a JMenuBarMgr. The specification includes: a display name for menu, a list of JMenuItemSpec components, an optional mnemonic key, and an optional MenuListener. The mnemonic key will be auto-assigned if omitted.

A JMenuBarMgr defines a menu bar consisting of JMenuSpec items. A JMenuSpec defines a menu consisting of JMenuItemSpec items.

Since:
CleanCode 0.9
Version:
$Revision: 9 $
Author:
Michael Sorens
See Also:
JMenuItemSpec, JMenuBarMgr

Field Summary
static String VERSION
          Current version of this class.
 
Constructor Summary
JMenuSpec(String displayName, JMenuItemSpec[] list)
          Creates a JMenuItem object where the mnemonic is auto-assigned, and without a MenuListener.
JMenuSpec(String displayName, JMenuItemSpec[] list, int mnemonic)
          Creates a JMenuSpec object without a MenuListener.
JMenuSpec(String displayName, JMenuItemSpec[] list, int mnemonic, MenuListener l)
          Creates a fully-specified JMenuSpec object.
JMenuSpec(String displayName, JMenuItemSpec[] list, MenuListener l)
          Creates a JMenuItem object where the mnemonic is auto-assigned.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
Current version of this class.

Constructor Detail

JMenuSpec

public JMenuSpec(String displayName,
                 JMenuItemSpec[] list,
                 int mnemonic,
                 MenuListener l)
Creates a fully-specified JMenuSpec object.

Parameters:
displayName - name to display as the menu name
list - list of items contained in the menu
mnemonic - a keyboard mnemonic (key which selects item when menu is open)
l - a MenuListener for this menu

JMenuSpec

public JMenuSpec(String displayName,
                 JMenuItemSpec[] list,
                 int mnemonic)
Creates a JMenuSpec object without a MenuListener.

Parameters:
displayName - name to display as the menu name
list - list of items contained in the menu
mnemonic - a keyboard mnemonic (key which selects item when menu is open)

JMenuSpec

public JMenuSpec(String displayName,
                 JMenuItemSpec[] list,
                 MenuListener l)
Creates a JMenuItem object where the mnemonic is auto-assigned.

Parameters:
displayName - name to display as the menu name
list - list of items contained in the menu
l - a MenuListener for this menu

JMenuSpec

public JMenuSpec(String displayName,
                 JMenuItemSpec[] list)
Creates a JMenuItem object where the mnemonic is auto-assigned, and without a MenuListener.

Parameters:
displayName - name to display as the menu name
list - list of items contained in the menu


CleanCode Java Libraries Copyright © 2001-2012 Michael Sorens - Revised 2012.12.10 Get CleanCode at SourceForge.net. Fast, secure and Free Open Source software downloads