org.xwiki.gwt.wysiwyg.client.plugin.submit
Class SubmitPlugin

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
      extended by org.xwiki.gwt.wysiwyg.client.plugin.submit.SubmitPlugin
All Implemented Interfaces:
com.google.gwt.event.dom.client.BlurHandler, com.google.gwt.event.shared.EventHandler, com.google.gwt.user.client.Window.ClosingHandler, CommandListener, Plugin
Direct Known Subclasses:
IESubmitPlugin

public class SubmitPlugin
extends org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
implements com.google.gwt.event.dom.client.BlurHandler, CommandListener, com.google.gwt.user.client.Window.ClosingHandler

Binds a RichTextArea to a form field.

Version:
$Id: SubmitPlugin.java 31679 2010-10-08 15:53:52Z mflorea $

Constructor Summary
SubmitPlugin()
           
 
Method Summary
 void destroy()
          Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor.
protected  JavaScriptObject getSubmitHandler()
           
protected  void hookSubmitEvent(Element form)
          Registers getSubmitHandler() as a listener for submit events generated by the given HTML form element.
 void init(RichTextArea textArea, Config config)
          Initialize the plug-in.
 boolean onBeforeCommand(CommandManager sender, Command command, java.lang.String param)
          
 void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
          
 void onCommand(CommandManager sender, Command command, java.lang.String param)
          
protected  void onSubmit()
          Called when the HTML form hosting the rich text area is submitted.
 void onWindowClosing(com.google.gwt.user.client.Window.ClosingEvent event)
          
protected  void unhookSubmitEvent(Element form)
          Unregisters getSubmitHandler() as a listener for submit events generated by the given HTML form element.
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
getConfig, getTextArea, getUIExtensionList, getUIExtensions, saveRegistration, saveRegistrations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubmitPlugin

public SubmitPlugin()
Method Detail

init

public void init(RichTextArea textArea,
                 Config config)
Initialize the plug-in. Plug-ins need to know the text area in order to provide only those feature that are supported.

Specified by:
init in interface Plugin
Overrides:
init in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
Parameters:
textArea - the text area of the editor
config - the configuration object
See Also:
AbstractPlugin.init(RichTextArea, Config)

destroy

public void destroy()
Notifies the plug-in to release its resources before being unloaded from the WYSIWYG editor.

Specified by:
destroy in interface Plugin
Overrides:
destroy in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin
See Also:
AbstractPlugin.destroy()

getSubmitHandler

protected JavaScriptObject getSubmitHandler()
Returns:
the JavaScript object that catches the submit event and calls onSubmit()

hookSubmitEvent

protected void hookSubmitEvent(Element form)
Registers getSubmitHandler() as a listener for submit events generated by the given HTML form element.

Parameters:
form - the HTML form element whose submit event should be listened

unhookSubmitEvent

protected void unhookSubmitEvent(Element form)
Unregisters getSubmitHandler() as a listener for submit events generated by the given HTML form element.

Parameters:
form - the HTML form element whose submit event shouldn't be listened anymore

onBlur

public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)

Specified by:
onBlur in interface com.google.gwt.event.dom.client.BlurHandler
See Also:
BlurHandler.onBlur(BlurEvent)

onSubmit

protected void onSubmit()
Called when the HTML form hosting the rich text area is submitted.


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)

onWindowClosing

public void onWindowClosing(com.google.gwt.user.client.Window.ClosingEvent event)

Specified by:
onWindowClosing in interface com.google.gwt.user.client.Window.ClosingHandler
See Also:
ClosingHandler#onWindowClosing(ClosingEvent)


Copyright © 2004-2010 XWiki. All Rights Reserved.