psdi.webclient.controls

Class RichTextControl

  • All Implemented Interfaces:
    java.lang.Cloneable, DataBeanListener
    Direct Known Subclasses:
    LongDescription


    public class RichTextControl
    extends ControlInstance
    implements DataBeanListener
    The class for the implementation of the Rich Text Control. This class primarily handles events related to spell checking and graceful degradation when the client does not support rich text editing.
    • Field Detail

      • PROP_RENDER_TEXT_AREA

        public static final java.lang.String PROP_RENDER_TEXT_AREA
        A property used when rendering in a mobile application that indicates that a text area should be shown instead of the rich text viewer which is shown if the value for this control contains html.
        See Also:
        Constant Field Values
      • PROP_REPLACEMENT_METHOD

        public static final java.lang.String PROP_REPLACEMENT_METHOD
        See Also:
        Constant Field Values
      • HOLDER_ID_SUFFIX

        public static final java.lang.String HOLDER_ID_SUFFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • RichTextControl

        public RichTextControl()
    • Method Detail

      • initialize

        public void initialize()
        Initializes this control. If the client does not support rich text, the appropriate viewer is selected.
        Overrides:
        initialize in class ControlInstance
      • spellcheck

        public int spellcheck()
                       throws MXException
        Forwards request to spellcheck_dialog
        Returns:
        WebClientBean.EVENT_HANDLED
        Throws:
        MXException
      • getCurrentValue

        public java.lang.String getCurrentValue()
      • spellcheckreturn

        public int spellcheckreturn()
                             throws MXException
        Registered call-back method for spell check dialog
        Returns:
        Throws:
        MXException
      • getDataAttribute

        public java.lang.String getDataAttribute()
      • getControlBean

        public DataBean getControlBean()
      • isRichTextSupported

        public boolean isRichTextSupported()
        Determines if the rich text editing is supported on this device. Currently mobile browsers do not support rich text editing, but this may change in the future.
        Returns:
        True if the client browser supports rich text editing.
      • render

        public int render()
                   throws java.lang.reflect.InvocationTargetException,
                          java.lang.IllegalAccessException,
                          java.lang.NoSuchMethodException
        Renders the RichTextControl. If rich text is not supported, the control is prepared to render either the rich text viewer or text area instead. This is currently only true for mobile devices although it could change in the future.
        Overrides:
        render in class ControlInstance
        Throws:
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
      • getChildComponent

        public BaseInstance getChildComponent(BaseInstance component,
                                              java.lang.String componentType)
        Gets the child component of the specified type from the base component. This method calls recursively down the component tree to find the component. The first component instance found of the specified type is returned.
        Parameters:
        component - The component instance. If it is of the specified type, it is returned.
        componentType - The component type to search for.
        Returns:
        The ComponentInstance found. Null is no instance could be found.