com.extjs.gxt.ui.client.widget.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.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.form.Field<java.lang.String>
                      extended by com.extjs.gxt.ui.client.widget.form.HtmlEditor
All Implemented Interfaces:
Observable, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

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

Provides a lightweight HTML Editor component.

Note: The focus/blur and validation marking functionality inherited from Field is NOT supported by this editor.

An Editor is a sensitive component that can't be used in all spots standard fields can be used. Putting an Editor within any element that has display set to 'none' can cause problems in Safari and Firefox due to their default iframe reloading bugs.

Events:
BeforeSync : HtmlEditorEvent(htmlEditor, change)
Fires before the iframe editor is updated with content from the textarea.
Sync : HtmlEditorEvent(htmlEditor, change)
Fires when the iframe editor is updated with content from the textarea.
EditModeChange : HtmlEditorEvent(htmlEditor, change)
Fires when the editor switches edit modes.


Nested Class Summary
 class HtmlEditor.HtmlEditorImages
           
 class HtmlEditor.HtmlEditorMessages
           
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.form.Field
Field.FieldImages, Field.FieldMessages
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
HtmlEditor()
           
 
Method Summary
 void blur()
          Tries to remove focus from the component.
 void focus()
          Try to focus this component.
 com.google.gwt.user.client.ui.RichTextArea.BasicFormatter getBasicFormatter()
          Gets the basic rich text formatting interface.
 com.google.gwt.user.client.ui.RichTextArea.ExtendedFormatter getExtendedFormatter()
          Gets the full rich text formatting interface.
 HtmlEditor.HtmlEditorImages getImages()
           
 HtmlEditor.HtmlEditorMessages getMessages()
          Returns the field's messages.
 java.lang.String getRawValue()
          Returns the raw data value which may or may not be a valid, defined value.
 java.lang.String getValue()
          Returns the typed value of the field.
 boolean isEnableAlignments()
           
 boolean isEnableColors()
           
 boolean isEnableFont()
           
 boolean isEnableFontSize()
           
 boolean isEnableFormat()
           
 boolean isEnableLinks()
           
 boolean isEnableLists()
           
 boolean isShowToolbar()
           
 boolean isSourceEditMode()
           
 void pushValue()
           
 void setEnableAlignments(boolean enableAlignments)
           
 void setEnableColors(boolean enableColors)
           
 void setEnableFont(boolean enableFont)
           
 void setEnableFontSize(boolean enableFontSize)
           
 void setEnableFormat(boolean enableFormat)
           
 void setEnableLinks(boolean enableLinks)
           
 void setEnableLists(boolean enableLists)
           
 void setRawValue(java.lang.String value)
          Sets the underlying DOM field's value directly, bypassing validation.
 void setShowToolbar(boolean showToolbar)
           
 void setSourceEditMode(boolean mode)
           
 void setValue(java.lang.String value)
          Sets a data value into the field and validates it.
 void syncValue()
           
 boolean validate(boolean silent)
          Validates the field value.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.form.Field
addInputStyleName, addKeyListener, clearInvalid, forceInvalid, getAutoValidate, getEmptyText, getErrorMessage, getFieldLabel, getLabelSeparator, getLabelStyle, getMessageTarget, getName, getOriginalValue, getPropertyEditor, getValidateOnBlur, getValidationDelay, isDirty, isFireChangeEventOnSetValue, isHideLabel, isInEditor, isReadOnly, isValid, isValid, markInvalid, onComponentEvent, removeInputStyleName, removeKeyListener, reset, setAutoValidate, setEmptyText, setFieldLabel, setFireChangeEventOnSetValue, setHideLabel, setImages, setInEditor, setLabelSeparator, setLabelStyle, setMessages, setMessageTarget, setName, setOriginalValue, setPropertyEditor, setReadOnly, setTabIndex, setValidateOnBlur, setValidationDelay, updateOriginalValue, validate
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, clearState, disable, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, getBaseStyle, getBorders, getContextMenu, getData, getElement, getHideMode, getId, getItemId, getListeners, getModel, getState, getStateId, getToolTip, hasListeners, hasListeners, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isStateful, isVisible, mask, mask, mask, onBrowserEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setBorders, setContextMenu, setData, setElement, setEnabled, setHideMode, setId, setIntStyleAttribute, setItemId, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlEditor

public HtmlEditor()
Method Detail

blur

public void blur()
Description copied from class: Component
Tries to remove focus from the component. Fires the Blur event.


focus

public void focus()
Description copied from class: Component
Try to focus this component. Fires the Focus event.

Overrides:
focus in class Field<java.lang.String>

getBasicFormatter

public com.google.gwt.user.client.ui.RichTextArea.BasicFormatter getBasicFormatter()
Gets the basic rich text formatting interface.

Returns:
null if basic formatting is not supported

getExtendedFormatter

public com.google.gwt.user.client.ui.RichTextArea.ExtendedFormatter getExtendedFormatter()
Gets the full rich text formatting interface.

Returns:
null if full formatting is not supported

getMessages

public HtmlEditor.HtmlEditorMessages getMessages()
Description copied from class: Field
Returns the field's messages.

Overrides:
getMessages in class Field<java.lang.String>
Returns:
the messages

getRawValue

public java.lang.String getRawValue()
Description copied from class: Field
Returns the raw data value which may or may not be a valid, defined value. To return a normalized value see Field.getValue().

Overrides:
getRawValue in class Field<java.lang.String>
Returns:
the raw value

getValue

public java.lang.String getValue()
Description copied from class: Field
Returns the typed value of the field.

Overrides:
getValue in class Field<java.lang.String>
Returns:
the fields value

getImages

public HtmlEditor.HtmlEditorImages getImages()
Overrides:
getImages in class Field<java.lang.String>

isEnableAlignments

public boolean isEnableAlignments()

isEnableColors

public boolean isEnableColors()

isEnableFont

public boolean isEnableFont()

isEnableFontSize

public boolean isEnableFontSize()

isEnableFormat

public boolean isEnableFormat()

isEnableLinks

public boolean isEnableLinks()

isEnableLists

public boolean isEnableLists()

isShowToolbar

public boolean isShowToolbar()

isSourceEditMode

public boolean isSourceEditMode()

pushValue

public void pushValue()

setEnableAlignments

public void setEnableAlignments(boolean enableAlignments)

setEnableColors

public void setEnableColors(boolean enableColors)

setEnableFont

public void setEnableFont(boolean enableFont)

setEnableFontSize

public void setEnableFontSize(boolean enableFontSize)

setEnableFormat

public void setEnableFormat(boolean enableFormat)

setEnableLinks

public void setEnableLinks(boolean enableLinks)

setEnableLists

public void setEnableLists(boolean enableLists)

setRawValue

public void setRawValue(java.lang.String value)
Description copied from class: Field
Sets the underlying DOM field's value directly, bypassing validation. To set the value with validation see Field.setValue(D).

Overrides:
setRawValue in class Field<java.lang.String>
Parameters:
value - the raw value

setShowToolbar

public void setShowToolbar(boolean showToolbar)

setSourceEditMode

public void setSourceEditMode(boolean mode)

setValue

public void setValue(java.lang.String value)
Description copied from class: Field
Sets a data value into the field and validates it. If the field is rendered, To set the value directly without validation see Field.setRawValue(java.lang.String).

Overrides:
setValue in class Field<java.lang.String>
Parameters:
value - the value to set

syncValue

public void syncValue()

validate

public boolean validate(boolean silent)
Description copied from class: Field
Validates the field value.

Overrides:
validate in class Field<java.lang.String>
Parameters:
silent - true to not mark the field valid and fire invalid event when invalid
Returns:
true if valid, otherwise false