com.jgoodies.looks.demo
Class MenuBarView

java.lang.Object
  extended by com.jgoodies.looks.demo.MenuBarView
Direct Known Subclasses:
MenuBarViewUIF

public class MenuBarView
extends Object

Builds the menu bar and pull-down menus in the Simple Looks Demo. Demonstrates and tests different multi-platform issues.

This class provides a couple of factory methods that create menu items, check box menu items, and radio button menu items. The full JGoodies Looks Demo overrides these methods to vend components from the JGoodies UI framework that better handle different platforms.

Version:
$Revision: 1.8 $
Author:
Karsten Lentzsch

Constructor Summary
MenuBarView()
           
 
Method Summary
(package private)  JMenuBar buildMenuBar(Settings settings, ActionListener helpActionListener, ActionListener aboutActionListener)
          Builds, configures, and returns the menubar.
protected  JCheckBoxMenuItem createCheckBoxMenuItem(String text, boolean selected)
           
protected  JMenu createMenu(String text, char mnemonic)
           
protected  JMenuItem createMenuItem(String text)
           
protected  JMenuItem createMenuItem(String text, char mnemonic)
           
protected  JMenuItem createMenuItem(String text, char mnemonic, KeyStroke key)
           
protected  JMenuItem createMenuItem(String text, Icon icon)
           
protected  JMenuItem createMenuItem(String text, Icon icon, char mnemonic)
           
protected  JMenuItem createMenuItem(String text, Icon icon, char mnemonic, KeyStroke key)
           
protected  JRadioButtonMenuItem createRadioButtonMenuItem(String text, boolean selected)
           
protected  String getToggleLabel(boolean enabled, boolean selected)
          Returns an appropriate label for the given enablement and selection state.
protected  boolean isAboutInOSMenu()
          Checks and answers whether the about action has been moved to an operating system specific menu, e.g. the OS X application menu.
protected  boolean isQuitInOSMenu()
          Checks and answers whether the quit action has been moved to an operating system specific menu, e.g. the OS X application menu.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuBarView

public MenuBarView()
Method Detail

buildMenuBar

JMenuBar buildMenuBar(Settings settings,
                      ActionListener helpActionListener,
                      ActionListener aboutActionListener)
Builds, configures, and returns the menubar. Requests HeaderStyle, look-specific BorderStyles, and Plastic 3D hint from Launcher.


createMenu

protected JMenu createMenu(String text,
                           char mnemonic)

createMenuItem

protected JMenuItem createMenuItem(String text)

createMenuItem

protected JMenuItem createMenuItem(String text,
                                   char mnemonic)

createMenuItem

protected JMenuItem createMenuItem(String text,
                                   char mnemonic,
                                   KeyStroke key)

createMenuItem

protected JMenuItem createMenuItem(String text,
                                   Icon icon)

createMenuItem

protected JMenuItem createMenuItem(String text,
                                   Icon icon,
                                   char mnemonic)

createMenuItem

protected JMenuItem createMenuItem(String text,
                                   Icon icon,
                                   char mnemonic,
                                   KeyStroke key)

createRadioButtonMenuItem

protected JRadioButtonMenuItem createRadioButtonMenuItem(String text,
                                                         boolean selected)

createCheckBoxMenuItem

protected JCheckBoxMenuItem createCheckBoxMenuItem(String text,
                                                   boolean selected)

isQuitInOSMenu

protected boolean isQuitInOSMenu()
Checks and answers whether the quit action has been moved to an operating system specific menu, e.g. the OS X application menu.

Returns:
true if the quit action is in an OS-specific menu

isAboutInOSMenu

protected boolean isAboutInOSMenu()
Checks and answers whether the about action has been moved to an operating system specific menu, e.g. the OS X application menu.

Returns:
true if the about action is in an OS-specific menu

getToggleLabel

protected String getToggleLabel(boolean enabled,
                                boolean selected)
Returns an appropriate label for the given enablement and selection state.



Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.