org.eodisp.ui.common.actions
Class EodispMenuManager

java.lang.Object
  extended by org.eodisp.ui.common.actions.EodispMenuManager

public class EodispMenuManager
extends java.lang.Object

EodispMenuManager handles the items in the menu bar, the tool bar, and the context menus for this application. It does this through the use of Actions.

Items for all these types of bar's can be added or removed at runtime. The EodispMenuManager can be used to update the UI as appropriate.

Version:
$Id:EodispMenuManager.java 2134 2006-05-16 08:43:27Z eglimi $
Author:
eglimi

Method Summary
 void addMenuSelectedListener(MenuSelectedListener l)
           
<T extends ActionSourceProvider>
javax.swing.JPopupMenu
getCtxMenu(java.lang.Class<T> type)
          This constructs a context menu.
static EodispMenuManager getInstance()
          Returns the only INSTANCE of this class.
 javax.swing.JMenuBar getMenuBar()
          Constructs the whole menu bar.
 javax.swing.JToolBar getToolBar()
          Constructs the whole tool bar.
 void removeMenuSelectedListener(MenuSelectedListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EodispMenuManager getInstance()
Returns the only INSTANCE of this class.

Returns:
The only INSTANCE of this class.

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Constructs the whole menu bar. This can be displayed in the main frame of the application.

Returns:
The complete menu bar.

getToolBar

public javax.swing.JToolBar getToolBar()
Constructs the whole tool bar. This can be displayed in the main frame of the application.

Returns:
The complete tool bar.

getCtxMenu

public <T extends ActionSourceProvider> javax.swing.JPopupMenu getCtxMenu(java.lang.Class<T> type)
This constructs a context menu. Entries can be hierarchical, depending on the top menu name of the action.

All dynamic entries are considered for inclusion into the context menu. The application have to take care of the entries in the EodispActionRegistry, before constructing this menu.

Returns:
The context menu that can be displayed as a pop-up menu in the application.

addMenuSelectedListener

public void addMenuSelectedListener(MenuSelectedListener l)

removeMenuSelectedListener

public void removeMenuSelectedListener(MenuSelectedListener l)