com.mucommander.ui.helper
Class MenuToolkit

java.lang.Object
  extended by com.mucommander.ui.helper.MenuToolkit

public class MenuToolkit
extends java.lang.Object

MenuToolkit provides convenient methods that make life easier when creating menus.

Author:
Maxence Bernard

Constructor Summary
MenuToolkit()
           
 
Method Summary
static javax.swing.JCheckBoxMenuItem addCheckBoxMenuItem(javax.swing.JMenu menu, MuAction action, MnemonicHelper mnemonicHelper)
           
static javax.swing.JCheckBoxMenuItem addCheckBoxMenuItem(javax.swing.JMenu menu, java.lang.String text, MnemonicHelper mnemonicHelper, javax.swing.KeyStroke accelerator, java.awt.event.ActionListener actionListener)
          Creates a new JCheckBoxMenuItem initially unselected and adds it to the given JMenu.
static javax.swing.JMenu addMenu(java.lang.String title, MnemonicHelper mnemonicHelper, javax.swing.event.MenuListener menuListener)
          Creates and returns a new JMenu.
static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, MuAction action, MnemonicHelper mnemonicHelper)
           
static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, java.lang.String text, MnemonicHelper mnemonicHelper, javax.swing.KeyStroke accelerator, java.awt.event.ActionListener actionListener)
          Creates a new JMenuItem and adds it to the given JMenu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuToolkit

public MenuToolkit()
Method Detail

addMenu

public static javax.swing.JMenu addMenu(java.lang.String title,
                                        MnemonicHelper mnemonicHelper,
                                        javax.swing.event.MenuListener menuListener)
Creates and returns a new JMenu.

Parameters:
title - title of the menu
mnemonicHelper - an optional (can be null) mnemonic helper which will be used along with the title to set a mnemonic to the menu.
menuListener - an optional (can be null) menu listener which will listen to the events triggered by the menu.

addMenuItem

public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu,
                                                java.lang.String text,
                                                MnemonicHelper mnemonicHelper,
                                                javax.swing.KeyStroke accelerator,
                                                java.awt.event.ActionListener actionListener)
Creates a new JMenuItem and adds it to the given JMenu.

Parameters:
menu - menu to add the menu item to.
text - text used by the menu item.
mnemonicHelper - an optional (can be null) mnemonic helper which will be used along with the item's text to set a mnemonic to the menu.
accelerator - an optional (can be null) keyboard shortcut used by the menu item.
actionListener - an optional (can be null) action listener which will listen to the events triggered by the menu item.

addCheckBoxMenuItem

public static javax.swing.JCheckBoxMenuItem addCheckBoxMenuItem(javax.swing.JMenu menu,
                                                                java.lang.String text,
                                                                MnemonicHelper mnemonicHelper,
                                                                javax.swing.KeyStroke accelerator,
                                                                java.awt.event.ActionListener actionListener)
Creates a new JCheckBoxMenuItem initially unselected and adds it to the given JMenu.

Parameters:
menu - menu to add the menu item to.
text - text used by the menu item.
mnemonicHelper - an optional (can be null) mnemonic helper which will be used along with the item's text to set a mnemonic to the menu.
accelerator - an optional (can be null) keyboard shortcut used by the menu item.
actionListener - an optional (can be null) action listener which will listen to the events triggered by the menu item.

addMenuItem

public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu,
                                                MuAction action,
                                                MnemonicHelper mnemonicHelper)

addCheckBoxMenuItem

public static javax.swing.JCheckBoxMenuItem addCheckBoxMenuItem(javax.swing.JMenu menu,
                                                                MuAction action,
                                                                MnemonicHelper mnemonicHelper)


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard