org.openbp.jaspira.action
Class ActionMgr

java.lang.Object
  extended by org.openbp.jaspira.action.ActionMgr

public final class ActionMgr
extends java.lang.Object

The (singleton) action manager provides access to Jaspira actions. This can be used to globally activate or deactivate a single action that is to be shared between plugins (load, save, etc.).

Author:
Stephan Moritz

Method Summary
 void addAction(JaspiraAction action)
          Add a new Action to the manager.
 JaspiraAction getAction(java.lang.String name)
          Returns the action with the given name or null if their is no such action.
static ActionMgr getInstance()
          Returns the singleton instance of the ActionMgr.
static char getMnemonicChar(java.lang.String s)
          Returns the mnemonic char of a string.
static java.lang.String getStringWithoutMnemonicDelimiter(java.lang.String s)
          Removes the mnemonic delimiter from a string.
 JaspiraAction removeAction(JaspiraAction action)
          Removes a JaspiraAction from the manager.
 JaspiraAction removeAction(java.lang.String name)
          Removes a JaspiraAction from the manager.
 void removeAllActions(java.util.Collection actions)
          Removes all actions in the given collection to the manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ActionMgr getInstance()
Returns the singleton instance of the ActionMgr.

Returns:
The ActionMgr, is created if necessary

addAction

public void addAction(JaspiraAction action)
Add a new Action to the manager. Returns true if the action is already existant. If the action is already registered, it is NOT replaced.

Parameters:
action - the action to add

removeAction

public JaspiraAction removeAction(java.lang.String name)
Removes a JaspiraAction from the manager. Returns the removed action or null if an action with the given name is not existant.

Parameters:
name - The name of the action to remove
Returns:
The removed action or null if the action was not registered

removeAction

public JaspiraAction removeAction(JaspiraAction action)
Removes a JaspiraAction from the manager. Returns the removed action or null if an action with the given name is not existant.

Parameters:
action - The action to be removed
Returns:
The removed action or null if the action was not registered

removeAllActions

public void removeAllActions(java.util.Collection actions)
Removes all actions in the given collection to the manager.

Parameters:
actions - A collection containing the actions to remove

getAction

public JaspiraAction getAction(java.lang.String name)
Returns the action with the given name or null if their is no such action.

Parameters:
name - The name (id) of the action to retrieve
Returns:
The action or null if no such action exists

getMnemonicChar

public static char getMnemonicChar(java.lang.String s)
Returns the mnemonic char of a string.

Parameters:
s - The raw string
Returns:
The mnemonic char or ? if the string does not contain the mnmonic delimiter

getStringWithoutMnemonicDelimiter

public static java.lang.String getStringWithoutMnemonicDelimiter(java.lang.String s)
Removes the mnemonic delimiter from a string.

Parameters:
s - The raw string
Returns:
The clean string


Copyright © 2011. All Rights Reserved.