com.lightdev.app
Class MenuApplication


java.lang.Object

  extended by com.lightdev.app.Application

      extended by com.lightdev.app.MenuApplication

Direct Known Subclasses:
DefaultApplication

public abstract class MenuApplication
extends Application

Application class that implements a menu from the application resource bundle

Version:
1, November 16, 2004
Author:
Ulrich Hilger, Light Development, http://www.lightdev.com, info@lightdev.com, published under the terms and conditions of the GNU General Public License, for details see file in the distribution package of this software as well as any licensing notes inside this documentation

Field Summary
static String menuSeparatorKey
          indicator for menu separators
static String RB_KEY_APP_MENUBAR
          resource bundle key to identify the string to use to read the menu bar definition
 
Fields inherited from class com.lightdev.app.Application
actionSuffix, APP_HELP_NAME, imageSuffix, JAVA_HELP_EXT, labelSuffix, logger, RB_KEY_ABOUT_APP_DIALOG_TITLE, RB_KEY_LOG_APP_CAN_NOT_EXIT, RB_KEY_LOG_APP_STARTED, RB_KEY_LOG_APP_TERMINATED, RESOURCE_NOT_FOUND, resources, selectedIconSuffix, toolTipSuffix, URL_SEPARATOR
 
Constructor Summary
MenuApplication()
           
MenuApplication(Level level, String logDir)
          constructor Looks for a resource bundle which is named similar to the class name inside the package of this class
MenuApplication(OutputStream logStream, Level level, String logDir)
          constructor Looks for a resource bundle which is named similar to the class name inside the package of this class
 
Method Summary
 JMenu createMenu(String key)
          Create a menu for the app.
 JMenuBar createMenubar(String name)
          Create a menu bar.
 JMenuBar createMenubar(String name, Color menuBackgroundColor)
          Create a menu bar.
 JMenuItem createMenuItem(String cmd)
          create a menu item
 JToolBar createToolBar(String nm)
          Create a tool bar.
 JMenuItem getMenuItem(String cmd)
           
 
Methods inherited from class com.lightdev.app.Application
about, addAction, canExit, exitApplication, getAction, getAppName, getBundle, getHelpBroker, getIconForCommand, getIconForName, getResource, getResourceString, initActions, log, logStackTrace, setLogging, setLogLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RB_KEY_APP_MENUBAR


public static final String RB_KEY_APP_MENUBAR
resource bundle key to identify the string to use to read the menu bar definition

See Also:
Constant Field Values

menuSeparatorKey


public static final String menuSeparatorKey
indicator for menu separators

See Also:
Constant Field Values
Constructor Detail

MenuApplication


public MenuApplication()

MenuApplication


public MenuApplication(OutputStream logStream,

                       Level level,

                       String logDir)
constructor

Looks for a resource bundle which is named similar to the class name inside the package of this class

Parameters:
logStream - OutputStream the stream to log to
level - Level log level to recognize in logs
logDir - String a directory to log to (e.g. ".appName" + File.separator + "logs")

MenuApplication


public MenuApplication(Level level,

                       String logDir)
constructor

Looks for a resource bundle which is named similar to the class name inside the package of this class

Parameters:
level - Level log level to recognize in logs
logDir - String a directory to log to (e.g. ".appName" + File.separator + "logs")
Method Detail

createToolBar


public JToolBar createToolBar(String nm)
Create a tool bar. This reads the definition of a tool bar from the associated resource file.

Parameters:
resources - the ResourceBundle to get the tool bar definition from
nm - the name of the tool bar definition in the resource file
Returns:
the created tool bar

createMenubar


public JMenuBar createMenubar(String name)
Create a menu bar. This reads the definition of the menu from the associated resource file.

Parameters:
name - name of the menu bar definition
Returns:
the created menu bar

createMenubar


public JMenuBar createMenubar(String name,

                              Color menuBackgroundColor)
Create a menu bar. This reads the definition of the menu from the associated resource file.

Parameters:
name - name of the menu bar definition
menuBackgroundColor - background color of menu bar
Returns:
the menu bar created

createMenu


public JMenu createMenu(String key)
Create a menu for the app. This reads the definition of the menu from the associated resource file.

Parameters:
resources - the ResourceBundle to get the menu definition from
key - the key of the menu definition in the resource file
Returns:
the created menu

getMenuItem


public JMenuItem getMenuItem(String cmd)

createMenuItem


public JMenuItem createMenuItem(String cmd)
create a menu item

Parameters:
resources - the ResourceBundle to get the item definition from
cmd - the action command to be associated with the new menu item
Returns:
the created menu item

Copyright (c) 2004, 2005 Ulrich Hilger