com.intellij.openapi.actionSystem
Class ActionManager

java.lang.Object
  extended by com.intellij.openapi.actionSystem.ActionManager

public abstract class ActionManager
extends java.lang.Object

A manager for actions. Used to register and unregister actions, also contains utility methods to easily fetch action by id and id by action.

See Also:
AnAction

Constructor Summary
ActionManager()
           
 
Method Summary
abstract  ActionPopupMenu createActionPopupMenu(java.lang.String place, ActionGroup group)
          Factory method that creates an ActionPopupMenu from the specified group.
abstract  ActionToolbar createActionToolbar(java.lang.String place, ActionGroup group, boolean horizontal)
          Factory method that creates an ActionToolbar from the specified group.
abstract  AnAction getAction(java.lang.String actionId)
          Returns action associated with the specified actionId.
abstract  java.lang.String getId(AnAction action)
          Returns actionId associated with the specified action.
static ActionManager getInstance()
          Fetches the instance of ActionManager implementation.
abstract  void registerAction(java.lang.String actionId, AnAction action)
          Registers the specified action with the specified id.
abstract  void registerAction(java.lang.String actionId, AnAction action, PluginId pluginId)
          Registers the specified action with the specified id.
abstract  void unregisterAction(java.lang.String actionId)
          Unregisters the action with the specified actionId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionManager

public ActionManager()
Method Detail

getInstance

public static ActionManager getInstance()
Fetches the instance of ActionManager implementation.


createActionPopupMenu

public abstract ActionPopupMenu createActionPopupMenu(java.lang.String place,
                                                      ActionGroup group)
Factory method that creates an ActionPopupMenu from the specified group. The specified place is associated with the created popup.

Parameters:
place - Determines the place that will be set for AnActionEvent passed when an action from the group is either performed or updated
group - Group from which the actions for the menu are taken.
Returns:
An instance of ActionPopupMenu

createActionToolbar

public abstract ActionToolbar createActionToolbar(java.lang.String place,
                                                  ActionGroup group,
                                                  boolean horizontal)
Factory method that creates an ActionToolbar from the specified group. The specified place is associated with the created toolbar.

Parameters:
place - Determines the place that will be set for AnActionEvent passed when an action from the group is either performed or updated
group - Group from which the actions for the toolbar are taken.
horizontal - The orientation of the toolbar (true - horizontal, false - vertical)
Returns:
An instance of ActionToolbar

getAction

public abstract AnAction getAction(@NotNull
                                   java.lang.String actionId)
Returns action associated with the specified actionId.

Parameters:
actionId - Id of the registered action
Returns:
Action associated with the specified actionId, null if there is no actions associated with the speicified actionId
Throws:
java.lang.IllegalArgumentException - if actionId is null

getId

public abstract java.lang.String getId(@NotNull
                                       AnAction action)
Returns actionId associated with the specified action.

Returns:
id associated with the specified action, null if action is not registered
Throws:
java.lang.IllegalArgumentException - if action is null

registerAction

public abstract void registerAction(@NotNull
                                    java.lang.String actionId,
                                    @NotNull
                                    AnAction action)
Registers the specified action with the specified id. Note that IDEA's keymaps processing deals only with registered actions.

Parameters:
actionId - Id to associate with the action
action - Action to register

registerAction

public abstract void registerAction(@NotNull
                                    java.lang.String actionId,
                                    @NotNull
                                    AnAction action,
                                    @Nullable
                                    PluginId pluginId)
Registers the specified action with the specified id.

Parameters:
actionId - Id to associate with the action
action - Action to register
pluginId - Identifier of the plugin owning the action. Used to show the actions in the correct place under the "Plugins" node in the "Keymap" settings pane and similar dialogs.

unregisterAction

public abstract void unregisterAction(@NotNull
                                      java.lang.String actionId)
Unregisters the action with the specified actionId.

Parameters:
actionId - Id of the action to be unregistered