public class WysiwygEditorApi extends Object
WysiwygEditor to the native JavaScript code.| Modifier and Type | Field and Description |
|---|---|
static Command |
SUBMIT
The command used to submit the value of the rich text area.
|
| Constructor and Description |
|---|
WysiwygEditorApi(JavaScriptObject jsConfig)
Creates a new
WysiwygEditor based on the given configuration object. |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addActionHandler(String actionName,
JavaScriptObject jsHandler)
Creates an action handler that wraps the given JavaScript function and registers it for the specified action.
|
CommandManagerApi |
getCommandManagerApi() |
String |
getParameter(String name) |
com.google.gwt.core.client.JsArrayString |
getParameterNames() |
com.google.gwt.dom.client.Element |
getPlainTextArea() |
com.google.gwt.dom.client.Element |
getRichTextArea() |
JavaScriptObject |
getSelectionRange() |
void |
getSourceText(JavaScriptObject onSuccess,
JavaScriptObject onFailure)
Sends a request to the server to convert the HTML output of the rich text editor to source text and calls one of
the given functions when the response is received.
|
static boolean |
isRichTextEditingSupported() |
static void |
publish()
Publishes the JavaScript API that can be used to create and control
WysiwygEditors. |
void |
release()
Releases the editor so that it can be garbage collected before the page is unloaded.
|
void |
setFocus(boolean focused)
Focuses or blurs the WYSIWYG editor.
|
void |
setSelectionRange(JavaScriptObject jsRange)
Sets the rich text area's selection range.
|
public static final Command SUBMIT
public WysiwygEditorApi(JavaScriptObject jsConfig)
WysiwygEditor based on the given configuration object.jsConfig - the JavaScriptObject used to configure the newly created editorpublic static boolean isRichTextEditingSupported()
true if the current browser supports rich text editing, false otherwisepublic void release()
public com.google.gwt.dom.client.Element getPlainTextArea()
public com.google.gwt.dom.client.Element getRichTextArea()
public void getSourceText(JavaScriptObject onSuccess, JavaScriptObject onFailure)
onSuccess - the JavaScript function to call on successonFailure - the JavaScript function to call on failurepublic CommandManagerApi getCommandManagerApi()
public com.google.gwt.event.shared.HandlerRegistration addActionHandler(String actionName, JavaScriptObject jsHandler)
actionName - the name of the action to listen tojsHandler - the JavaScript function to be called when the specified action occurspublic String getParameter(String name)
name - the name of a configuration parameterpublic com.google.gwt.core.client.JsArrayString getParameterNames()
public void setFocus(boolean focused)
focused - true to focus the WYSIWYG editor, false to blur itpublic JavaScriptObject getSelectionRange()
public void setSelectionRange(JavaScriptObject jsRange)
jsRange - a JavaScript object that has these properties: startContainer, startOffset,
endContainer and endOffsetpublic static void publish()
WysiwygEditors.Copyright © 2004–2014 XWiki. All rights reserved.