com.jgoodies.metamorphosis
Class MenuBarView

java.lang.Object
  extended by com.jgoodies.metamorphosis.MenuBarView

final class MenuBarView
extends Object

Builds a menu bar that demonstrates a bunch of menus with a mix different menu items and menu item states.

Version:
$Revision: 1.5 $
Author:
Karsten Lentzsch

Field Summary
private  JMenuBar menuBar
          Holds the lazily created menu bar.
 
Constructor Summary
MenuBarView()
           
 
Method Summary
(package private)  void addCheckMenuItems(JMenu menu)
          Builds and answers a menu with different JCheckBoxMenuItems.
(package private)  void addRadioMenuItems(JMenu menu)
          Builds and answers a menu with different JRadioButtonMenuItems.
(package private)  JMenu buildFileMenu()
          Builds and answers the file menu.
private  JMenuBar buildMenuBar()
          Builds and returns the menu bar.
private  JMenu buildStubMenu(String name, char mnemonic)
          Creates and answer a stub menu for the given name.
private  JCheckBoxMenuItem createCheckItem(boolean enabled, boolean selected)
          Creates and answers a check box with the given enablement and selection state.
private  JRadioButtonMenuItem createRadioItem(boolean enabled, boolean selected)
          Creates and answers a radio button with the given enablement and selection state.
(package private)  JMenuBar getMenuBar()
          Lazily builds and returns this view's menu bar.
private  String getToggleLabel(boolean enabled, boolean selected)
          Return a string label for the given enablement and selection state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menuBar

private JMenuBar menuBar
Holds the lazily created menu bar.

Constructor Detail

MenuBarView

MenuBarView()
Method Detail

getMenuBar

JMenuBar getMenuBar()
Lazily builds and returns this view's menu bar.

Returns:
the lazily built menu bar

buildMenuBar

private JMenuBar buildMenuBar()
Builds and returns the menu bar.


buildFileMenu

JMenu buildFileMenu()
Builds and answers the file menu.


buildStubMenu

private JMenu buildStubMenu(String name,
                            char mnemonic)
Creates and answer a stub menu for the given name.


addRadioMenuItems

void addRadioMenuItems(JMenu menu)
Builds and answers a menu with different JRadioButtonMenuItems.


addCheckMenuItems

void addCheckMenuItems(JMenu menu)
Builds and answers a menu with different JCheckBoxMenuItems.


createRadioItem

private JRadioButtonMenuItem createRadioItem(boolean enabled,
                                             boolean selected)
Creates and answers a radio button with the given enablement and selection state.


createCheckItem

private JCheckBoxMenuItem createCheckItem(boolean enabled,
                                          boolean selected)
Creates and answers a check box with the given enablement and selection state.


getToggleLabel

private String getToggleLabel(boolean enabled,
                              boolean selected)
Return a string label for the given enablement and selection state.



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