com.tensegrity.skeleton.swing.launch
Class MenuLaunchTask

java.lang.Object
  extended bycom.tensegrity.gui.launch.LaunchTask
      extended bycom.tensegrity.skeleton.swing.launch.AbstractLaunchTask
          extended bycom.tensegrity.skeleton.swing.launch.MenuLaunchTask
Direct Known Subclasses:
EditMenuLaunchTask, FileMenuLaunchTask, GraphPanelPopupMenuLaunchTask, HelpMenuLaunchTask, ToolMenuLaunchTask, ViewMenuLaunchTask, WindowMenuLaunchTask

public abstract class MenuLaunchTask
extends AbstractLaunchTask

Class MenuLaunchTask has been provided as a base class for all menu-related LaunchTask classes. It provides helper methods to create the appropriate menu items.

Version:
$Id: MenuLaunchTask.java,v 1.29 2005/11/07 13:19:05 KevinCVS Exp $
Author:
GillesIachelini

Nested Class Summary
protected static class MenuLaunchTask.MenuItemWrapper
          Simple wrapper for returning two values in the getMenuItem() method
 
Field Summary
 
Fields inherited from class com.tensegrity.gui.launch.LaunchTask
lasterror, LAUNCHTASKSTATUS_FATAL, LAUNCHTASKSTATUS_FATAL_RETRY, LAUNCHTASKSTATUS_SERIOUS, LAUNCHTASKSTATUS_SERIOUS_RETRY, LAUNCHTASKSTATUS_SHUTDOWN, LAUNCHTASKSTATUS_SUCCESS, LAUNCHTASKSTATUS_WARNING
 
Constructor Summary
MenuLaunchTask(ApplicationFrame applicationFrame)
          Constructor
MenuLaunchTask(ApplicationFrame applicationFrame, java.lang.String nameKey)
          Constructor
 
Method Summary
protected  void addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, javax.swing.KeyStroke stroke, java.lang.String iconurl)
          The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, javax.swing.KeyStroke stroke, java.lang.String iconurl, java.lang.Class referenceClass)
          The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.
protected  void addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, javax.swing.KeyStroke stroke, java.lang.String iconurl, java.lang.String defaulticon)
          The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, javax.swing.KeyStroke stroke, java.lang.String iconurl, java.lang.String defaulticon, java.lang.Class referenceClass)
          The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, java.lang.String iconurl)
          Adds a new Item to the parameter Menu.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, java.lang.String iconurl, java.lang.String defaulticon)
          Adds a new Item to the parameter Menu.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.util.HashMap uiMap, java.lang.String id, java.lang.String iconurl, java.lang.String defaulticon, java.lang.Class referenceClass)
          Adds a new Item to the parameter Menu.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.lang.String id, java.lang.Class refClass)
          The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.
protected  javax.swing.JMenuItem addToMenu(SwingMenu menu, java.lang.String id, java.lang.Class refClass, javax.swing.KeyStroke stroke)
          The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.
protected  SwingMenu createMenu(java.lang.String idText)
          Creates a SwingMenu and sets the text according to the currently set Language pack.
protected  MenuLaunchTask.MenuItemWrapper getMenuItem(SwingMenu menu, java.lang.String id)
          Returns the menu item for the command with the given id
 
Methods inherited from class com.tensegrity.skeleton.swing.launch.AbstractLaunchTask
findResourceText, getApplicationFrame, getName, getStatusPrefix, getStatusPrefixResourceKey, postCreate
 
Methods inherited from class com.tensegrity.gui.launch.LaunchTask
getError, getStatusDetails, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuLaunchTask

public MenuLaunchTask(ApplicationFrame applicationFrame)
Constructor

Parameters:
applicationFrame - Application context for this LaunchTask.

MenuLaunchTask

public MenuLaunchTask(ApplicationFrame applicationFrame,
                      java.lang.String nameKey)
Constructor

Parameters:
applicationFrame - a valid instance of ApplicationFrame.
nameKey - the resource key for the name of this launchtask
Method Detail

createMenu

protected SwingMenu createMenu(java.lang.String idText)
Creates a SwingMenu and sets the text according to the currently set Language pack. Note: You still have to add this menu to the UIMap of the ApplicationFrame.

Parameters:
idText - the text to create the Menu from.
Returns:
a newly created instance of SwingMenu, which will be added to this application ui map and filled with the text associated to the idText parameter.

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.util.HashMap uiMap,
                                                java.lang.String id,
                                                java.lang.String iconurl)
Adds a new Item to the parameter Menu. The class used as a reference in order to retrieve the images is com.tensegrity.skeleton.Skeleton.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
iconurl - the name of the icon to use.

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.util.HashMap uiMap,
                                                java.lang.String id,
                                                java.lang.String iconurl,
                                                java.lang.String defaulticon)
Adds a new Item to the parameter Menu. The class used as a reference in order to retrieve the images is com.tensegrity.skeleton.Skeleton.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
iconurl - the name of the icon to use.
defaulticon - the name of the icon to use when being in the windows laf.

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.util.HashMap uiMap,
                                                java.lang.String id,
                                                java.lang.String iconurl,
                                                java.lang.String defaulticon,
                                                java.lang.Class referenceClass)
Adds a new Item to the parameter Menu.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
iconurl - the name of the icon to use.
defaulticon - the name of the icon to use when being in the windows laf.
referenceClass - Class used as reference in order to retrieve the images

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.util.HashMap uiMap,
                                                java.lang.String id,
                                                javax.swing.KeyStroke stroke,
                                                java.lang.String iconurl,
                                                java.lang.Class referenceClass)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
stroke - the key stroke.
iconurl - the name of the icon to use.
referenceClass - Class used as reference in order to retrieve the images

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.util.HashMap uiMap,
                                                java.lang.String id,
                                                javax.swing.KeyStroke stroke,
                                                java.lang.String iconurl,
                                                java.lang.String defaulticon,
                                                java.lang.Class referenceClass)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
stroke - the key stroke.
iconurl - the name of the icon to use.
defaulticon - the name of the icon to use when being in the windows laf.
referenceClass - Class used as reference in order to retrieve the images

addToMenu

protected final void addToMenu(SwingMenu menu,
                               java.util.HashMap uiMap,
                               java.lang.String id,
                               javax.swing.KeyStroke stroke,
                               java.lang.String iconurl)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. The class used as a reference in order to retrieve the images is com.tensegrity.skeleton.Skeleton.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
stroke - the key stroke.
iconurl - the name of the icon to use.

addToMenu

protected final void addToMenu(SwingMenu menu,
                               java.util.HashMap uiMap,
                               java.lang.String id,
                               javax.swing.KeyStroke stroke,
                               java.lang.String iconurl,
                               java.lang.String defaulticon)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. The class used as a reference in order to retrieve the images is com.tensegrity.skeleton.Skeleton.

Parameters:
menu - the Menu to add the element to.
uiMap - the uiMap to add the element too.
id - the command id.
stroke - the key stroke.
iconurl - the name of the icon to use.
defaulticon - the name of the icon to use when being in the windows laf.

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.lang.String id,
                                                java.lang.Class refClass,
                                                javax.swing.KeyStroke stroke)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. The class used as a reference in order to retrieve the images is refClass.

Parameters:
menu - the Menu to add the element to.
id - the command id.
refClass - The reference class used to load the icon resource.
stroke - the key stroke.

addToMenu

protected final javax.swing.JMenuItem addToMenu(SwingMenu menu,
                                                java.lang.String id,
                                                java.lang.Class refClass)
The method addToMenu adds a new command to the given menu and stores the icons, required for a smooth switch as properties of the action. The class used as a reference in order to retrieve the images is refClass.

Parameters:
menu - the Menu to add the element to.
id - the command id.
refClass - The reference class used to load the icon resource

getMenuItem

protected MenuLaunchTask.MenuItemWrapper getMenuItem(SwingMenu menu,
                                                     java.lang.String id)
Returns the menu item for the command with the given id

Parameters:
menu - The menu that contains the item
id - The id to look for
Returns:
A wrapper struct containing the menu item and its index or null, if there was no matching item


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.