org.xwiki.gwt.wysiwyg.client
Class ToolBarController

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.ToolBarController

public class ToolBarController
extends Object

ToolBar controller.

Version:
$Id: 1a747a610af329ab14c90e28cb610cba38ec2abc $

Field Summary
static String DEFAULT_TOOLBAR_FEATURES
          The list of features this controller will attempt to place on the tool bar by default if the configuration doesn't specify the tool bar features.
static String TOOLBAR_ROLE
          The string used to identify the tool bar extension point.
 
Constructor Summary
ToolBarController(ToolBar toolBar)
          Creates a new tool bar controller.
 
Method Summary
 void destroy()
          Destroys this tool bar controller.
 void fill(Config config, PluginManager pluginManager)
          Fills the tool bar with the features specified in the configuration.
 List<String> split(String toolBar, PluginManager pluginManager)
          Splits a string representing the tool bar feature list into its components, i.e.
 void update(RichTextArea richTextArea, SyntaxValidator syntaxValidator)
          Updates the tool bar state, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOOLBAR_ROLE

public static final String TOOLBAR_ROLE
The string used to identify the tool bar extension point.

See Also:
Constant Field Values

DEFAULT_TOOLBAR_FEATURES

public static final String DEFAULT_TOOLBAR_FEATURES
The list of features this controller will attempt to place on the tool bar by default if the configuration doesn't specify the tool bar features.

See Also:
Constant Field Values
Constructor Detail

ToolBarController

public ToolBarController(ToolBar toolBar)
Creates a new tool bar controller.

Parameters:
toolBar - the tool bar to be managed
Method Detail

fill

public void fill(Config config,
                 PluginManager pluginManager)
Fills the tool bar with the features specified in the configuration.

Parameters:
config - the configuration object
pluginManager - the object used to access the tool bar UIExtensions

update

public void update(RichTextArea richTextArea,
                   SyntaxValidator syntaxValidator)
Updates the tool bar state, i.e. disables/enables tool bar features, based on the given set of rules and the current state of the rich text area.

Parameters:
richTextArea - the rich text area whose state is used to determine if a feature must be enabled or disabled
syntaxValidator - the object used to assert if a feature must be enabled or disabled in the current state of the rich text area

split

public List<String> split(String toolBar,
                          PluginManager pluginManager)
Splits a string representing the tool bar feature list into its components, i.e. feature names, and removes useless separators (e.g. to avoid empty lines or empty groups) and unavailable features.

Parameters:
toolBar - a string listing the tool bar features separated by ToolBarSeparator.VERTICAL_BAR or ToolBarSeparator.LINE_BREAK
pluginManager - the object used to check which tool bar features are available
Returns:
the list of available tool bar features in the order they appear on the tool bar

destroy

public void destroy()
Destroys this tool bar controller.



Copyright © 2004-2012 XWiki. All Rights Reserved.