com.sencha.gxt.widget.core.client.form
Class HtmlEditor

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.container.Container
                  extended by com.sencha.gxt.widget.core.client.container.ResizeContainer
                      extended by com.sencha.gxt.widget.core.client.container.SimpleContainer
                          extended by com.sencha.gxt.widget.core.client.form.AdapterField<java.lang.String>
                              extended by com.sencha.gxt.widget.core.client.form.HtmlEditor
All Implemented Interfaces:
Editor<java.lang.String>, HasEditorDelegate<java.lang.String>, HasEditorErrors<java.lang.String>, LeafValueEditor<java.lang.String>, HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, TakesValue<java.lang.String>, AcceptsOneWidget, HasEnabled, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, HasLayout, AddEvent.HasAddHandlers, BeforeAddEvent.HasBeforeAddHandlers, BeforeHideEvent.HasBeforeHideHandlers, BeforeRemoveEvent.HasBeforeRemoveHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, ContainerHandler.HasContainerHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, InvalidEvent.HasInvalidHandlers, MoveEvent.HasMoveHandlers, RemoveEvent.HasRemoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, ValidEvent.HasValidHandlers, IsField<java.lang.String>, HasFocusSupport, HasItemId, java.lang.Iterable<Widget>

public class HtmlEditor
extends AdapterField<java.lang.String>

Provides an HTML-based rich text editor with a tool bar for selecting formatting options, including fonts, text justification, lists, hyperlinks and text color. Enables switching between formatted and HTML editing modes. Supports copy and paste from Web pages as well as text editing features provided by the browser (e.g. spell checking, text search).

By default, all formatting options are enabled and available via the tool bar. To disable one or more options, use the appropriate setter before adding the HTML editor to its container.


Nested Class Summary
static interface HtmlEditor.HtmlEditorAppearance
          The appearance of this class.
static interface HtmlEditor.HtmlEditorMessages
          The locale-sensitive messages used by this class.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.editor.client.Editor
Editor.Ignore, Editor.Path
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
HtmlEditor()
          Creates an HTML-based rich text editor with support for fonts, text justification, lists, hyperlinks and text color.
HtmlEditor(HtmlEditor.HtmlEditorAppearance appearance)
          Creates an HTML-based rich text editor with support for fonts, text justification, lists, hyperlinks and text color.
 
Method Summary
 HtmlEditor.HtmlEditorMessages getMessages()
          Returns the locale-sensitive messages used by this class.
 java.lang.String getValue()
           
 boolean isEnableAlignments()
          Returns true if text justification is enabled.
 boolean isEnableColors()
          Returns true if setting text foreground and background colors is enabled.
 boolean isEnableFont()
          Returns true if setting font family name is enabled.
 boolean isEnableFontSize()
          Returns true if setting font size is enabled.
 boolean isEnableFormat()
          Returns true if setting font style is enabled.
 boolean isEnableLinks()
          Returns true if creating a hyperlink from selected text is enabled.
 boolean isEnableLists()
          Returns true if creating lists is enabled.
 boolean isShowToolbar()
          Returns true if the tool bar is displayed.
 boolean isSourceEditMode()
          Returns true if the ability to switch to HTML source mode is enabled.
 void pushValue()
          Copies the value of the HTML source editor to the rich text editor.
 void setEnableAlignments(boolean enableAlignments)
          Sets whether text justification is enabled.
 void setEnableColors(boolean enableColors)
          Sets whether setting text foreground and background colors is enabled.
 void setEnableFont(boolean enableFont)
          Sets whether setting font family name is enabled.
 void setEnableFontSize(boolean enableFontSize)
          Sets whether setting font size is enabled.
 void setEnableFormat(boolean enableFormat)
          Sets whether setting font style is enabled.
 void setEnableLinks(boolean enableLinks)
          Sets whether creating a hyperlink from selected text is enable.
 void setEnableLists(boolean enableLists)
          Sets whether creating lists is enabled.
 void setMessages(HtmlEditor.HtmlEditorMessages messages)
          Sets the local-sensitive messages used by this class.
 void setValue(java.lang.String value)
           
 void syncValue()
          Copies the value of the rich text editor to the HTML source editor.
 
Methods inherited from class com.sencha.gxt.widget.core.client.form.AdapterField
addInvalidHandler, addValidator, addValidHandler, clear, clearInvalid, disable, enable, forceInvalid, getErrorSupport, getValidators, isValid, isValid, markInvalid, removeValidator, reset, setDelegate, setErrorSupport, showErrors, validate, validate
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.SimpleContainer
add, add, getWidget, isResize, setResize, setWidget, setWidget
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.Container
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
 

Constructor Detail

HtmlEditor

public HtmlEditor()
Creates an HTML-based rich text editor with support for fonts, text justification, lists, hyperlinks and text color.


HtmlEditor

public HtmlEditor(HtmlEditor.HtmlEditorAppearance appearance)
Creates an HTML-based rich text editor with support for fonts, text justification, lists, hyperlinks and text color.

Method Detail

getMessages

public HtmlEditor.HtmlEditorMessages getMessages()
Returns the locale-sensitive messages used by this class.

Returns:
the local-sensitive messages used by this class.

getValue

public java.lang.String getValue()

isEnableAlignments

public boolean isEnableAlignments()
Returns true if text justification is enabled.

Returns:
if text justification is enabled

isEnableColors

public boolean isEnableColors()
Returns true if setting text foreground and background colors is enabled.

Returns:
if setting text foreground and background colors is enabled

isEnableFont

public boolean isEnableFont()
Returns true if setting font family name is enabled.

Returns:
if setting font family name is enabled

isEnableFontSize

public boolean isEnableFontSize()
Returns true if setting font size is enabled.

Returns:
true if setting font size is enabled

isEnableFormat

public boolean isEnableFormat()
Returns true if setting font style is enabled.

Returns:
true if setting font style is enabled

isEnableLinks

public boolean isEnableLinks()
Returns true if creating a hyperlink from selected text is enabled.

Returns:
true if creating a hyperlink from selected text is enabled

isEnableLists

public boolean isEnableLists()
Returns true if creating lists is enabled.

Returns:
true if creating lists is enabled

isShowToolbar

public boolean isShowToolbar()
Returns true if the tool bar is displayed.

Returns:
true if the tool bar is displayed

isSourceEditMode

public boolean isSourceEditMode()
Returns true if the ability to switch to HTML source mode is enabled.

Returns:
true if the ability to switch to HTML source mode is enabled

pushValue

public void pushValue()
Copies the value of the HTML source editor to the rich text editor.


setEnableAlignments

public void setEnableAlignments(boolean enableAlignments)
Sets whether text justification is enabled.

Parameters:
enableAlignments - true to enable text justification

setEnableColors

public void setEnableColors(boolean enableColors)
Sets whether setting text foreground and background colors is enabled.

Parameters:
enableColors - true to enable setting text foreground and background colors.

setEnableFont

public void setEnableFont(boolean enableFont)
Sets whether setting font family name is enabled.

Parameters:
enableFont - true to enable setting font family name

setEnableFontSize

public void setEnableFontSize(boolean enableFontSize)
Sets whether setting font size is enabled.

Parameters:
enableFontSize - true to enable setting font size

setEnableFormat

public void setEnableFormat(boolean enableFormat)
Sets whether setting font style is enabled.

Parameters:
enableFormat - true to enable setting font style

setEnableLinks

public void setEnableLinks(boolean enableLinks)
Sets whether creating a hyperlink from selected text is enable.

Parameters:
enableLinks - true to enable creating a hyperlink from selected text

setEnableLists

public void setEnableLists(boolean enableLists)
Sets whether creating lists is enabled.

Parameters:
enableLists - true to enable creating lists

setMessages

public void setMessages(HtmlEditor.HtmlEditorMessages messages)
Sets the local-sensitive messages used by this class.

Parameters:
messages - the locale sensitive messages used by this class.

setValue

public void setValue(java.lang.String value)

syncValue

public void syncValue()
Copies the value of the rich text editor to the HTML source editor.



Copyright © 2012. All Rights Reserved.