org.eodisp.ui.common.actions
Class EodispActionRegistry

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

public class EodispActionRegistry
extends java.lang.Object

The EodispActionRegistry is used to register Action's. These actions can be used for menu bar, too bar, and context menu entries. The purpose of this class is to have a central place where all actions are registered and from where actions can be retrieved for further processing.

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

Field Summary
(package private) static org.apache.log4j.Logger logger
          Log4J logger for this class
 
Method Summary
 void addActionChangedListener(EodispActionListener l)
           
<T extends ActionSourceProvider>
void
clearActions(java.lang.Class<T> registrar)
          This clears all actions registered by a specific view.
<T extends ActionSourceProvider>
void
disableActions()
          Disables all actions which are not always visible.
<T extends ActionSourceProvider>
java.util.List<EodispAction>
getContextMenuActions(java.lang.Class<T> type)
          Returns a list of all actions registered in this registry which should be displayed in a tool bar.
static EodispActionRegistry getInstance()
          Return the only INSTANCE of this class (singleton).
 java.util.List<EodispAction> getMenuBarActions()
          Returns a list of all actions registered in this registry which should be displayed in a menu bar.
 java.util.List<EodispAction> getToolBarActions()
          Returns a list of all actions registered in this registry which should be displayed in a tool bar.
 void registerAction(EodispAction source)
          Adds an action to the list of known actions for this application.
<T extends ActionSourceProvider>
void
registerAction(EodispAction source, java.lang.Class<T> registrar)
          Adds an action to the list of known actions for this application.
 void registerActions(java.util.List<EodispAction> actions)
          This can be used to register a list of actions instead of only one.
<T extends ActionSourceProvider>
void
registerActions(java.util.List<EodispAction> actions, java.lang.Class<T> registrar)
          This can be used to register a list of actions instead of only one.
 void removeActionChangedListener(EodispActionListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Log4J logger for this class

Method Detail

getInstance

public static EodispActionRegistry getInstance()
Return the only INSTANCE of this class (singleton).

Returns:
The only INSTANCE of this class.

registerAction

public void registerAction(EodispAction source)
Adds an action to the list of known actions for this application.

Parameters:
source - The action to be added to the list of actions for this application.

registerAction

public <T extends ActionSourceProvider> void registerAction(EodispAction source,
                                                            java.lang.Class<T> registrar)
Adds an action to the list of known actions for this application.

Parameters:
source - The action to be added to the list of actions for this application.
registrar - The class which is responsible for registering this event.

registerActions

public void registerActions(java.util.List<EodispAction> actions)
This can be used to register a list of actions instead of only one. This might be useful to register dynamic actions.

Parameters:
actions - A list including of actions of type EodispAction.

registerActions

public <T extends ActionSourceProvider> void registerActions(java.util.List<EodispAction> actions,
                                                             java.lang.Class<T> registrar)
This can be used to register a list of actions instead of only one. This might be useful to register dynamic actions.

Parameters:
actions - A list including of actions of type EodispAction.
registrar - The class which is responsible for registering this event.

clearActions

public <T extends ActionSourceProvider> void clearActions(java.lang.Class<T> registrar)
This clears all actions registered by a specific view. This is useful if the view is disposed or if the view registers dynamic actions.

Parameters:
registrar - The class that registered the actions. If null is given, all actions are removed.
onlyDanamic - If set to true, only actions that are dynamic are removed from the registry, otherwise all actions are removed from the registry.

disableActions

public <T extends ActionSourceProvider> void disableActions()
Disables all actions which are not always visible.


getMenuBarActions

public java.util.List<EodispAction> getMenuBarActions()
Returns a list of all actions registered in this registry which should be displayed in a menu bar.

Returns:
The list with all actions. If no actions are found, the list will be empty.

getToolBarActions

public java.util.List<EodispAction> getToolBarActions()
Returns a list of all actions registered in this registry which should be displayed in a tool bar.

Returns:
The list with all actions. If no actions are found, the list will be empty.

getContextMenuActions

public <T extends ActionSourceProvider> java.util.List<EodispAction> getContextMenuActions(java.lang.Class<T> type)
Returns a list of all actions registered in this registry which should be displayed in a tool bar.

Parameters:
type - The type for which the context menu actions should be returned. If this parameter is null, the context menu actions for all types are returned.
Returns:
The list with all actions. If no actions are found, the list will be empty.

addActionChangedListener

public void addActionChangedListener(EodispActionListener l)

removeActionChangedListener

public void removeActionChangedListener(EodispActionListener l)