org.xwiki.gwt.wysiwyg.client
Class RichTextEditorController

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.RichTextEditorController
All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyUpHandler, com.google.gwt.event.dom.client.LoadHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.shared.EventHandler, CommandListener, Updatable
Direct Known Subclasses:
WysiwygEditor

public class RichTextEditorController
extends Object
implements Updatable, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.dom.client.KeyUpHandler, CommandListener, com.google.gwt.event.dom.client.LoadHandler

A RichTextEditor controller.

Version:
$Id: f7899038e21bfe438c2330d8031841071fff3cf3 $

Field Summary
static String DEFAULT_PLUGINS
          The list of plugins this controller will attempt to load by default if the configuration doesn't specify which plugins to load.
static String DEFAULT_ROOT_UI_EXTENSIONS
          The list of default extensions for the rootUI extension point.
 
Constructor Summary
RichTextEditorController(RichTextEditor richTextEditor, Config config, PluginFactoryManager pfm, SyntaxValidator syntaxValidator)
          Creates a new editor.
 
Method Summary
 boolean canUpdate()
          
 void destroy()
          Destroys this editor, unregistering all the listeners and releasing the used memory.
protected  void extendRootUI()
          Loads the root user interface extensions.
 Config getConfigurationSource()
           
 RichTextEditor getRichTextEditor()
          Get the rich text editor.
protected  void loadPlugins()
          Loads the plugins specified in the configuration.
protected  void maybeInitialize()
          Initialize the rich text editor if it wasn't already initialized.
 boolean onBeforeCommand(CommandManager sender, Command command, String param)
          
 void onCommand(CommandManager sender, Command command, String param)
          
 void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
          
 void onLoad(com.google.gwt.event.dom.client.LoadEvent event)
          
 void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
          
protected  void saveRegistration(com.google.gwt.event.shared.HandlerRegistration registration)
          Saves a handler registration in order for the handler to be automatically removed when the plug-in is destroyed.
 void update()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PLUGINS

public static final String DEFAULT_PLUGINS
The list of plugins this controller will attempt to load by default if the configuration doesn't specify which plugins to load.

See Also:
Constant Field Values

DEFAULT_ROOT_UI_EXTENSIONS

public static final String DEFAULT_ROOT_UI_EXTENSIONS
The list of default extensions for the rootUI extension point.

See Also:
Constant Field Values
Constructor Detail

RichTextEditorController

public RichTextEditorController(RichTextEditor richTextEditor,
                                Config config,
                                PluginFactoryManager pfm,
                                SyntaxValidator syntaxValidator)
Creates a new editor.

Parameters:
richTextEditor - the rich text editor to manage
config - the configuration source
pfm - the plugin factory manager used to instantiate plugins
syntaxValidator - the object used to assert if a feature must be enabled or disabled in some context
Method Detail

onMouseUp

public void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)

Specified by:
onMouseUp in interface com.google.gwt.event.dom.client.MouseUpHandler
See Also:
MouseUpHandler.onMouseUp(MouseUpEvent)

onKeyUp

public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)

Specified by:
onKeyUp in interface com.google.gwt.event.dom.client.KeyUpHandler
See Also:
KeyUpHandler.onKeyUp(KeyUpEvent)

onBeforeCommand

public boolean onBeforeCommand(CommandManager sender,
                               Command command,
                               String param)

Specified by:
onBeforeCommand in interface CommandListener
See Also:
CommandListener.onBeforeCommand(CommandManager, Command, String)

onCommand

public void onCommand(CommandManager sender,
                      Command command,
                      String param)

Specified by:
onCommand in interface CommandListener
See Also:
CommandListener.onCommand(CommandManager, Command, String)

onLoad

public void onLoad(com.google.gwt.event.dom.client.LoadEvent event)

Specified by:
onLoad in interface com.google.gwt.event.dom.client.LoadHandler
See Also:
LoadHandler.onLoad(LoadEvent)

maybeInitialize

protected void maybeInitialize()
Initialize the rich text editor if it wasn't already initialized.


loadPlugins

protected void loadPlugins()
Loads the plugins specified in the configuration.


extendRootUI

protected void extendRootUI()
Loads the root user interface extensions.


update

public void update()

Specified by:
update in interface Updatable
See Also:
Updatable.update()

canUpdate

public boolean canUpdate()

Specified by:
canUpdate in interface Updatable
See Also:
Updatable.canUpdate()

getRichTextEditor

public RichTextEditor getRichTextEditor()
Get the rich text editor. Creates it if it does not exist.

Returns:
the rich text editor

getConfigurationSource

public Config getConfigurationSource()
Returns:
this editor's configuration source

saveRegistration

protected void saveRegistration(com.google.gwt.event.shared.HandlerRegistration registration)
Saves a handler registration in order for the handler to be automatically removed when the plug-in is destroyed.

Parameters:
registration - the handler registration to be saved

destroy

public void destroy()
Destroys this editor, unregistering all the listeners and releasing the used memory.



Copyright © 2004-2013 XWiki. All Rights Reserved.