org.olat.core.gui.components.form.flexible.impl.elements.richText
Class RichTextElementImpl

java.lang.Object
  extended by org.olat.core.gui.components.form.flexible.impl.FormItemImpl
      extended by org.olat.core.gui.components.form.flexible.impl.elements.AbstractTextElement
          extended by org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextElementImpl
All Implemented Interfaces:
InlineElement, RichTextElement, TextElement, FormBaseComponentIdProvider, FormItem, Disposable

public class RichTextElementImpl
extends AbstractTextElement
implements RichTextElement, Disposable

Description:
This class implements a rich text form element based on the TinyMCE javascript library.

Initial Date: 21.04.2009

Author:
gnaegi

Field Summary
 
Fields inherited from interface org.olat.core.gui.components.form.flexible.FormItem
ERRORC, EXAMPLEC, LABELC
 
Fields inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
DISPPREFIX
 
Constructor Summary
RichTextElementImpl(java.lang.String name, java.lang.String predefinedValue, int rows, int cols, Form form)
          Constructor for specialized TextElements, i.e.
 
Method Summary
 void addActionListener(Controller listener, int action)
           
 void dispose()
          disposes the disposable
 void evalFormRequest(UserRequest ureq)
          gets called if the implementing component is part of a form which gets partly submitted -> extract data for you and store it temporarly for redisplay without a validation
 RichTextConfiguration getEditorConfiguration()
          Get the rich text editor configuration object
 java.lang.String getRawValue()
          Get the raw value of the text element as submitted by the user.
 java.lang.String getValue()
          Get the value of the text element.
 
Methods inherited from class org.olat.core.gui.components.form.flexible.impl.elements.AbstractTextElement
getValue, isEmpty, isEmpty, reset, setDisplaySize, setIsEqualCheck, setItemValidatorProvider, setMaxLength, setNewOriginalValue, setNotEmptyCheck, setNotLongerThanCheck, setRegexMatchCheck, setValue, validate
 
Methods inherited from class org.olat.core.gui.components.form.flexible.impl.FormItemImpl
clearError, doDispatchFormRequest, getAction, getActionListenersFor, getComponent, getEmptyDisplayText, getErrorC, getErrorText, getExampleC, getExampleText, getFormDispatchId, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isInlineEditingOn, isMandatory, isVisible, setEmptyDisplayText, setEnabled, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setTranslator, setUserObject, setVisible, showError, showExample, showLabel, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.elements.TextElement
getValue, isEmpty, isEmpty, setDisplaySize, setIsEqualCheck, setItemValidatorProvider, setMaxLength, setNewOriginalValue, setNotEmptyCheck, setNotLongerThanCheck, setRegexMatchCheck, setValue
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormItem
clearError, doDispatchFormRequest, getAction, getActionListenersFor, getComponent, getErrorC, getErrorText, getExampleC, getExampleText, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isMandatory, isVisible, reset, setEnabled, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setTranslator, setUserObject, setVisible, showError, showExample, showLabel, validate
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
getFormDispatchId
 

Constructor Detail

RichTextElementImpl

public RichTextElementImpl(java.lang.String name,
                           java.lang.String predefinedValue,
                           int rows,
                           int cols,
                           Form form)
Constructor for specialized TextElements, i.e. IntegerElementImpl.

Parameters:
name -
predefinedValue - Initial value
rows - the number of lines or -1 to use default value (resizeable)
cols - the number of characters per line or -1 to use 100% of the available space
form - The dispatch ID of the root form that deals with the submit button
Method Detail

getValue

public java.lang.String getValue()
Description copied from interface: TextElement
Get the value of the text element.

Specified by:
getValue in interface TextElement
Overrides:
getValue in class AbstractTextElement
Returns:
String
See Also:
The returned value is XSS save and does not contain executable JavaScript code. If you want to get the raw user data use the getRawValue() method.

getRawValue

public java.lang.String getRawValue()
Description copied from interface: RichTextElement
Get the raw value of the text element as submitted by the user. Be aware that this method does NOT filter against XSS attacks! Use this only when you manually check for XSS attacks or you allow users at this point to add unsave data including javascript code.

Specified by:
getRawValue in interface RichTextElement
Returns:
See Also:
RichTextElement.getRawValue()

evalFormRequest

public void evalFormRequest(UserRequest ureq)
Description copied from class: FormItemImpl
gets called if the implementing component is part of a form which gets partly submitted -> extract data for you and store it temporarly for redisplay without a validation

Specified by:
evalFormRequest in interface FormItem
Specified by:
evalFormRequest in class FormItemImpl
See Also:
org.olat.core.gui.components.form.flexible.FormItemImpl#evalFormRequest(org.olat.core.gui.UserRequest)

getEditorConfiguration

public RichTextConfiguration getEditorConfiguration()
Description copied from interface: RichTextElement
Get the rich text editor configuration object

Specified by:
getEditorConfiguration in interface RichTextElement
Returns:
See Also:
org.olat.core.gui.components.form.flexible.elements.RichTextElement#getRichTextConfiguration()

dispose

public void dispose()
Description copied from interface: Disposable
disposes the disposable

Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

addActionListener

public void addActionListener(Controller listener,
                              int action)
Specified by:
addActionListener in interface FormItem
Overrides:
addActionListener in class FormItemImpl
See Also:
org.olat.core.gui.components.form.flexible.FormItem#addActionListenerFor(org.olat.core.gui.control.Controller, int)