com.xpn.xwiki.wysiwyg.client.editor
Class WysiwygEditor

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.editor.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 java.lang.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

The controller part of the WYSIWYG editor.

Version:
$Id: WysiwygEditor.java 26263 2010-01-20 17:34:36Z mflorea $

Field Summary
static java.lang.String DEFAULT_SYNTAX
          The default storage syntax.
protected static int SOURCE_TAB_INDEX
          Source tab index in the TabPanel.
protected static int WYSIWYG_TAB_INDEX
          WYWISYWG tab index in the TabPanel.
 
Constructor Summary
WysiwygEditor(Config config, SyntaxValidatorManager svm, PluginFactoryManager pfm)
          Creates a new WYSIWYG editor.
 
Method Summary
 boolean canUpdate()
          
 void destroy()
          Destroys this WYSIWYG editor, unregistering all the listeners and releasing the used memory.
 Config getConfig()
           
 PlainTextEditor getPlainTextEditor()
          Get the plain text editor.
 RichTextEditor getRichTextEditor()
          Get the rich 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.
 boolean onBeforeCommand(CommandManager sender, Command command, java.lang.String param)
          
 void onCommand(CommandManager sender, Command command, java.lang.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)
          
 void setSelectedTab(int index)
          Sets the selected tab.
 void update()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SYNTAX

public static final java.lang.String DEFAULT_SYNTAX
The default storage syntax.

See Also:
Constant Field Values

WYSIWYG_TAB_INDEX

protected static final int WYSIWYG_TAB_INDEX
WYWISYWG tab index in the TabPanel.

See Also:
Constant Field Values

SOURCE_TAB_INDEX

protected static final int SOURCE_TAB_INDEX
Source tab index in the TabPanel.

See Also:
Constant Field Values
Constructor Detail

WysiwygEditor

public WysiwygEditor(Config 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

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,
                               java.lang.String param)

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

onCommand

public void onCommand(CommandManager sender,
                      Command command,
                      java.lang.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)

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()

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 editor User Interface main panel.

getRichTextEditor

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

Returns:
The rich text editor.

getPlainTextEditor

public PlainTextEditor getPlainTextEditor()
Get the plain text editor.

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

getConfig

public Config getConfig()
Returns:
this editor's configuration object

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

destroy

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



Copyright © 2004-2010 XWiki. All Rights Reserved.