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

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$

Constructor Summary
SubmitPlugin()
           
 
Method Summary
 void destroy()
           
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)
           
 boolean onBeforeCommand(CommandManager sender, Command command, String param)
           
 void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
           
 void onCommand(CommandManager sender, Command command, 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)
Specified by:
init in interface Plugin
Overrides:
init in class org.xwiki.gwt.wysiwyg.client.plugin.internal.AbstractPlugin

destroy

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

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

onSubmit

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


onBeforeCommand

public boolean onBeforeCommand(CommandManager sender,
                               Command command,
                               String param)
Specified by:
onBeforeCommand in interface CommandListener

onCommand

public void onCommand(CommandManager sender,
                      Command command,
                      String param)
Specified by:
onCommand in interface CommandListener

onWindowClosing

public void onWindowClosing(com.google.gwt.user.client.Window.ClosingEvent event)
Specified by:
onWindowClosing in interface com.google.gwt.user.client.Window.ClosingHandler


Copyright © 2004-2012 XWiki. All Rights Reserved.