to.etc.domui.component.htmleditor
Class HtmlEditor

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.NodeContainer
              extended by to.etc.domui.dom.html.InputNodeContainer
                  extended by to.etc.domui.dom.html.TextArea
                      extended by to.etc.domui.component.htmleditor.HtmlEditor
All Implemented Interfaces:
java.lang.Iterable<NodeBase>, IModelBinding, IBindable, INodeErrorDelegate, IActionControl, IControl<java.lang.String>, IDisplayControl<java.lang.String>, IHasChangeListener, IHasModifiedIndication, IInputNode<java.lang.String>

public class HtmlEditor
extends TextArea

This is a small but very fast html editor. It shows way faster than the full Html editor but has a little less options. This uses a slightly adapter version of the wysigyg plugin.

One oddity in the code here is the handling of the "display" css property. The plugin adds a div just before the original textarea, then it makes the textarea display: none. The textarea is retained so the plugin can put it's content in there still. DomUI however will reset the display:none value after a value is entered because the changeAttribute call sent will clear it (the attribute is BLOCK in the DomUI DOM). To prevent this we set the attribute to BLOCK on a full render and reset it back no none as soon as a partial delta is to be rendered by listening for input on this control.

Author:
Frits Jalvingh Created on Feb 19, 2010

Constructor Summary
HtmlEditor()
           
 
Method Summary
 boolean acceptRequestParameter(java.lang.String[] values)
           
 void createContent()
           
 java.lang.String getStyleSheet()
          Contains the in-editor stylesheet to use, which determines the presentation\ of the document inside the editor.
 void onBeforeFullRender()
           
 void setStyleSheet(java.lang.String styleSheet)
           
 
Methods inherited from class to.etc.domui.dom.html.TextArea
bind, getCols, getRawValue, getRows, getValue, getValueSafe, hasError, isBound, isDisabled, isModified, setCols, setDisabled, setModified, setRows, setValue, validate, visit
 
Methods inherited from class to.etc.domui.dom.html.InputNodeContainer
callOnValueChanged, getOnValueChanged, isMandatory, isReadOnly, setMandatory, setOnValueChanged, setReadOnly
 
Methods inherited from class to.etc.domui.dom.html.NodeContainer
add, add, add, addTable, canContain, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, addCssClass, addGlobalMessage, afterCreateContent, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, componentHandleWebAction, findComponentBundle, getActualID, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetTag, isBuilt, isFocusRequested, onAddedToPage, onForceRebuild, onHeaderContributors, onRemoveFromPage, onShelve, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setTestID, setTitle, setUserObject, stretchHeight, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface to.etc.domui.dom.html.IControl
getErrorLocation, isMandatory, isReadOnly, setErrorLocation, setMandatory, setReadOnly
 
Methods inherited from interface to.etc.domui.dom.html.IDisplayControl
setTestID
 
Methods inherited from interface to.etc.domui.dom.html.IActionControl
setTestID
 
Methods inherited from interface to.etc.domui.dom.html.IHasChangeListener
getOnValueChanged, setOnValueChanged
 
Methods inherited from interface to.etc.domui.dom.errors.INodeErrorDelegate
clearMessage, getMessage, setMessage
 

Constructor Detail

HtmlEditor

public HtmlEditor()
Method Detail

createContent

public void createContent()
                   throws java.lang.Exception
Overrides:
createContent in class NodeBase
Throws:
java.lang.Exception

getStyleSheet

public java.lang.String getStyleSheet()
                               throws java.lang.Exception
Contains the in-editor stylesheet to use, which determines the presentation\ of the document inside the editor. If not set it defaults to THEME/minieditor.css.

Returns:
Throws:
java.lang.Exception

setStyleSheet

public void setStyleSheet(java.lang.String styleSheet)

onBeforeFullRender

public void onBeforeFullRender()
                        throws java.lang.Exception
Overrides:
onBeforeFullRender in class NodeBase
Throws:
java.lang.Exception

acceptRequestParameter

public boolean acceptRequestParameter(java.lang.String[] values)
                               throws java.lang.Exception
Overrides:
acceptRequestParameter in class TextArea
Throws:
java.lang.Exception