org.xwiki.gwt.wysiwyg.client
Class WysiwygEditor

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.RichTextEditorController
      extended by org.xwiki.gwt.wysiwyg.client.WysiwygEditor
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

public class WysiwygEditor
extends RichTextEditorController

A what-you-see-is-what-you-get rich text editor.

Version:
$Id: 0267df946814c0c87b1adbf5c3f4f83275de9603 $

Field Summary
 
Fields inherited from class org.xwiki.gwt.wysiwyg.client.RichTextEditorController
DEFAULT_PLUGINS, DEFAULT_ROOT_UI_EXTENSIONS
 
Constructor Summary
WysiwygEditor(Config config, SyntaxValidatorManager svm, PluginFactoryManager pfm)
          Creates a new WYSIWYG editor.
WysiwygEditor(WysiwygEditorConfig config, SyntaxValidatorManager svm, PluginFactoryManager pfm)
          Creates a new WYSIWYG editor.
 
Method Summary
 void destroy()
          Destroys this editor, unregistering all the listeners and releasing the used memory.
 WysiwygEditorConfig getConfig()
           
 PlainTextEditor getPlainTextEditor()
          Get the plain text editor.
 int getSelectedTab()
           
 com.google.gwt.user.client.ui.Widget getUI()
          In a Model-View-Controller architecture the UI represents the View component, while this class represents the Controller.
protected  void maybeInitializeRichTextEditor()
          Initializes the rich text editor if it wasn't already initialized.
 void onLoad(com.google.gwt.event.dom.client.LoadEvent event)
          
 void setSelectedTab(int index)
          Sets the selected tab.
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.RichTextEditorController
canUpdate, extendRootUI, getConfigurationSource, getRichTextEditor, loadPlugins, maybeInitialize, onBeforeCommand, onCommand, onKeyUp, onMouseUp, saveRegistration, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WysiwygEditor

public WysiwygEditor(Config config,
                     SyntaxValidatorManager svm,
                     PluginFactoryManager pfm)
Creates a new WYSIWYG editor.

Parameters:
config - the configuration source
svm - the syntax validation manager used for enabling or disabling plugin features
pfm - the plugin factory manager used to instantiate plugins

WysiwygEditor

public WysiwygEditor(WysiwygEditorConfig config,
                     SyntaxValidatorManager svm,
                     PluginFactoryManager pfm)
Creates a new WYSIWYG editor.

Parameters:
config - the configuration object
svm - the syntax validation manager used for enabling or disabling plugin features
pfm - the plugin factory manager used to instantiate plugins
Method Detail

onLoad

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

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

maybeInitializeRichTextEditor

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


getUI

public com.google.gwt.user.client.ui.Widget getUI()
In a Model-View-Controller architecture the UI represents the View component, while this class represents the Controller. The model could be considered the DOM document edited.

Returns:
the user interface of the editor, i.e. the rich text editor if tabs are disabled, the tab panel otherwise

getPlainTextEditor

public PlainTextEditor getPlainTextEditor()
Get the plain text editor.

Returns:
the plain text editor, null if it does not exist

getSelectedTab

public int getSelectedTab()
Returns:
the index of the currently selected tab

setSelectedTab

public void setSelectedTab(int index)
Sets the selected tab.

Parameters:
index - the tab index

getConfig

public WysiwygEditorConfig getConfig()
Returns:
the configuration object

destroy

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

Overrides:
destroy in class RichTextEditorController
See Also:
RichTextEditorController.destroy()


Copyright © 2004–2015 XWiki. All rights reserved.