Class ActionController

  extended by com.ephox.editlive.custom.ActionController

public class ActionController
extends Object

Central point for managing menubar and toolbar items from the configuration file. Menu items and toolbar buttons are both created referencing an EphoxAction - see AbstractButton.setAction(Action) for more details on Action / Button interaction.

Action instances are unique, so changing one action will automatically update any menu items or toolbar buttons that reference it.

Action instances are indexed using the name from the configuration file. Valid actions that can be accessed are:

Instance available via ELJBean.getActionController().

NOTE: Methods on this class must not be called before the editor has finished loading.


Method Summary
 EphoxAction getAction(Map<String,String> map)
          Get an action and override existing settings.
 EphoxAction getAction(String name)
          Get the action with the specified name.
 EphoxAction getToolbarFromConfigItem(ConfigItem configItem)
          Creates an EphoxAction containing all items for a given toolbar in EphoxAction.getSubItems().
 EphoxAction updateAction(String name, Map<String,?> actionSettings)
          Populate an action from a map.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public EphoxAction getAction(String name)
Get the action with the specified name.

name - the name of the action to retrieve.
the EphoxAction matching name or null if no action is defined with that name.


public EphoxAction getAction(Map<String,String> map)
Get an action and override existing settings. Valid settings that can be overridden are listed in the customToolbarButton documentation.

map - Action definition to search for and update
Action that has been updated, or null if no Action matches the name specified in the map


public EphoxAction updateAction(String name,
                                Map<String,?> actionSettings)
Populate an action from a map.

If the name refers to a valid action, this calls Action.putValue(String, Object) for each item in the map and then returns the action.

This differs from getAction(Map) in that everything in the map is passed to the Action, not just valid custom settings.

name - Action to update
actionSettings - Map of settings to put in the action
Updated action, or null if no action is defined with that name


public EphoxAction getToolbarFromConfigItem(ConfigItem configItem)
Creates an EphoxAction containing all items for a given toolbar in EphoxAction.getSubItems(). Useful for passing to ToolbarFactory.createInlineToolbar(EphoxAction,boolean).

configItem - Configuration reference for the parent "toolbar" or "inlineToolbar" configuration element
Populated EphoxAction instance, or null if configItem does not reference a toolbar

Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved.