org.richfaces.renderkit
Class EditorRendererBase

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.ajax4jsf.renderkit.RendererBase
          extended by org.ajax4jsf.renderkit.HeaderResourcesRendererBase
              extended by org.ajax4jsf.renderkit.AjaxComponentRendererBase
                  extended by org.richfaces.renderkit.InputRendererBase
                      extended by org.richfaces.renderkit.EditorRendererBase
All Implemented Interfaces:
org.ajax4jsf.renderkit.ChameleonRenderer, org.ajax4jsf.renderkit.HeaderResourceProducer, org.ajax4jsf.renderkit.HeaderResourceProducer2, org.ajax4jsf.resource.ResourceProduser
Direct Known Subclasses:
EditorRenderer

public class EditorRendererBase
extends org.richfaces.renderkit.InputRendererBase

Editor component renderer base class.

Author:
Alexandr Levkovsky

Field Summary
 
Fields inherited from class org.ajax4jsf.renderkit.RendererBase
JAVASCRIPT_NAMESPACE
 
Constructor Summary
EditorRendererBase()
           
 
Method Summary
protected  void doDecode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  java.lang.Class<? extends javax.faces.component.UIComponent> getComponentClass()
           
 java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object submittedValue)
           
protected  java.lang.String getCssMappingSuffix(javax.faces.context.FacesContext context)
          Method to get exact xcss resource URI suffix
protected  java.lang.String getFormattedComponentStringValue(javax.faces.context.FacesContext context, UIEditor component)
          Method to get converted to String model value or if validation not passed submitted value for component
protected  java.lang.String getSriptMappingSuffix(javax.faces.context.FacesContext context)
          Method to get exact script resource URI suffix
 java.lang.String getTextAreaStyle(UIEditor component)
          Method to get target textarea style if width or height attributes was determined
 boolean shouldRenderTinyMCE(UIEditor component)
          Method to check if rendering of tinyMCE scripts needed.
 void writeEditorConfigurationAttributes(javax.faces.context.FacesContext context, UIEditor component)
          Method to write tinyMCE configuration script parameters from Editor component attributes.
 void writeEditorConfigurationParameters(javax.faces.context.FacesContext context, UIEditor component)
          Method to write tinyMCE configuration script parameters from property file if it was determined through Editor configuration attribute.
 void writeEditorCustomPluginsParameters(javax.faces.context.FacesContext context, UIEditor component)
          Method to write custom plugins script parameters from property file if it was determined through Editor configuration attribute.
 void writeEditorParameters(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Method to write tinyMCE configuration script parameters which was defined as children for Editor
 
Methods inherited from class org.richfaces.renderkit.InputRendererBase
getInputValue
 
Methods inherited from class org.ajax4jsf.renderkit.AjaxComponentRendererBase
getAdditionalScripts, getScripts
 
Methods inherited from class org.ajax4jsf.renderkit.HeaderResourcesRendererBase
encodeResourcesArray, encodeToHead, getHeaderScripts, getHeaderStyles, getStyles
 
Methods inherited from class org.ajax4jsf.renderkit.RendererBase
addResource, decode, doEncodeBegin, doEncodeChildren, doEncodeEnd, encodeBegin, encodeChildren, encodeEnd, getResource, getSkin, getUtils, preDecode, preEncodeBegin, renderChild, renderChildren
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getRendersChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ajax4jsf.renderkit.HeaderResourceProducer2
encodeToHead
 

Constructor Detail

EditorRendererBase

public EditorRendererBase()
Method Detail

getComponentClass

protected java.lang.Class<? extends javax.faces.component.UIComponent> getComponentClass()
Overrides:
getComponentClass in class org.richfaces.renderkit.InputRendererBase

getConvertedValue

public java.lang.Object getConvertedValue(javax.faces.context.FacesContext context,
                                          javax.faces.component.UIComponent component,
                                          java.lang.Object submittedValue)
                                   throws javax.faces.convert.ConverterException
Overrides:
getConvertedValue in class org.richfaces.renderkit.InputRendererBase
Throws:
javax.faces.convert.ConverterException

doDecode

protected void doDecode(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
Overrides:
doDecode in class org.richfaces.renderkit.InputRendererBase

getFormattedComponentStringValue

protected java.lang.String getFormattedComponentStringValue(javax.faces.context.FacesContext context,
                                                            UIEditor component)
Method to get converted to String model value or if validation not passed submitted value for component

Parameters:
context - - faces context instance
component - - component for which method is applied
Returns:
converted to String component value

getSriptMappingSuffix

protected java.lang.String getSriptMappingSuffix(javax.faces.context.FacesContext context)
Method to get exact script resource URI suffix

Parameters:
context - - faces context instance
Returns:
string with script resource URI suffix

getCssMappingSuffix

protected java.lang.String getCssMappingSuffix(javax.faces.context.FacesContext context)
Method to get exact xcss resource URI suffix

Parameters:
context - - faces context instance
Returns:
string with xcss resource URI suffix

writeEditorConfigurationParameters

public void writeEditorConfigurationParameters(javax.faces.context.FacesContext context,
                                               UIEditor component)
                                        throws java.io.IOException
Method to write tinyMCE configuration script parameters from property file if it was determined through Editor configuration attribute.

Parameters:
context - - faces context instance
component - - Editor component instance
Throws:
java.io.IOException

writeEditorCustomPluginsParameters

public void writeEditorCustomPluginsParameters(javax.faces.context.FacesContext context,
                                               UIEditor component)
                                        throws java.io.IOException
Method to write custom plugins script parameters from property file if it was determined through Editor configuration attribute.

Parameters:
context - - faces context instance
component - - Editor component instance
Throws:
java.io.IOException

writeEditorConfigurationAttributes

public void writeEditorConfigurationAttributes(javax.faces.context.FacesContext context,
                                               UIEditor component)
                                        throws java.io.IOException
Method to write tinyMCE configuration script parameters from Editor component attributes.

Parameters:
context - - faces context instance
component - - Editor component instance
Throws:
java.io.IOException

writeEditorParameters

public void writeEditorParameters(javax.faces.context.FacesContext context,
                                  javax.faces.component.UIComponent component)
                           throws java.io.IOException
Method to write tinyMCE configuration script parameters which was defined as children for Editor

Parameters:
context - - faces context instance
component - - Editor component instance
Throws:
java.io.IOException

shouldRenderTinyMCE

public boolean shouldRenderTinyMCE(UIEditor component)
Method to check if rendering of tinyMCE scripts needed.

Parameters:
component - - Editor component instance
Returns:
true if needed or false if only target textarea should be rendered

getTextAreaStyle

public java.lang.String getTextAreaStyle(UIEditor component)
Method to get target textarea style if width or height attributes was determined

Parameters:
component - - Editor component instance
Returns:
string with style properties


Copyright © 2010. All Rights Reserved.