org.sakaiproject.jsf.renderer
Class InputRichTextRenderer

java.lang.Object
  extended byjavax.faces.render.Renderer
      extended byorg.sakaiproject.jsf.renderer.InputRichTextRenderer

public class InputRichTextRenderer
extends Renderer

Formerly RichTextEditArea.java

Renders a rich text editor and toolbar within an HTML "textarea" element.

The textarea is decorated using the HTMLArea JavaScript library.

HTMLArea is a free, customizable online editor. It works inside your browser. It uses a non-standard feature implemented in Internet Explorer 5.5 or better for Windows and Mozilla 1.3 or better (any platform), therefore it will only work in one of these browsers.

HTMLArea is copyright InteractiveTools.com and released under a BSD-style license. HTMLArea is created and developed upto version 2.03 by InteractiveTools.com. Version 3.0 developed by Mihai Bazon for InteractiveTools. It contains code sponsored by other companies as well.

Copyright: Copyright (c) 2004 Sakai

Version:
$Id: InputRichTextRenderer.java 7107 2006-03-28 13:52:30Z lance@indiana.edu $
Author:
cwen@iu.edu, Ed Smiley esmiley@stanford.edu (modifications)

Constructor Summary
InputRichTextRenderer()
           
 
Method Summary
protected  String addToolbar(String toolbar)
           
 void decode(FacesContext context, UIComponent component)
          Standard decode method.
 void encodeBegin(FacesContext context, UIComponent component)
           
protected  int getSize(Object attchedFiles)
           
protected  String outputFiles(List list)
           
protected  String outputFiles(Map map)
           
protected  void registerWithParent(UIComponent component, String configVar, String clientId)
           
 boolean supportsComponentType(UIComponent component)
           
protected  void writeAdditionalConfig(FacesContext context, UIComponent component, String configVar, String clientId, String toolbar, int widthPx, int heightPx, Locale locale, ResponseWriter writer)
          subclasses can override to provide additonal configuration such as add buttons, etc
protected  void writeAttachedFiles(FacesContext context, UIComponent component, String configVar, ResponseWriter writer, String toolbar)
           
protected  void writeConfigurationScript(FacesContext context, UIComponent component, String clientId, String toolbar, int widthPx, int heightPx, String showXPath, Locale locale, ResponseWriter writer)
          Write configuration script
protected  void writeExternalScripts(Locale locale, ResponseWriter writer)
           
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeChildren, encodeEnd, getConvertedValue, getRendersChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputRichTextRenderer

public InputRichTextRenderer()
Method Detail

supportsComponentType

public boolean supportsComponentType(UIComponent component)

encodeBegin

public void encodeBegin(FacesContext context,
                        UIComponent component)
                 throws IOException
Throws:
IOException

writeExternalScripts

protected void writeExternalScripts(Locale locale,
                                    ResponseWriter writer)
                             throws IOException
Parameters:
writer -
Throws:
IOException

decode

public void decode(FacesContext context,
                   UIComponent component)
Standard decode method.

Parameters:
context -
component -

writeConfigurationScript

protected void writeConfigurationScript(FacesContext context,
                                        UIComponent component,
                                        String clientId,
                                        String toolbar,
                                        int widthPx,
                                        int heightPx,
                                        String showXPath,
                                        Locale locale,
                                        ResponseWriter writer)
                                 throws IOException
Write configuration script

Parameters:
clientId - the client id
toolbar - the toolbar configuration string (i.e from makeToolbarScript())
widthPx - columns
heightPx - rows
Throws:
IOException

writeAdditionalConfig

protected void writeAdditionalConfig(FacesContext context,
                                     UIComponent component,
                                     String configVar,
                                     String clientId,
                                     String toolbar,
                                     int widthPx,
                                     int heightPx,
                                     Locale locale,
                                     ResponseWriter writer)
                              throws IOException
subclasses can override to provide additonal configuration such as add buttons, etc

Parameters:
context -
component -
configVar -
clientId -
toolbar -
widthPx -
heightPx -
locale -
writer -
Throws:
IOException

writeAttachedFiles

protected void writeAttachedFiles(FacesContext context,
                                  UIComponent component,
                                  String configVar,
                                  ResponseWriter writer,
                                  String toolbar)
                           throws IOException
Throws:
IOException

registerWithParent

protected void registerWithParent(UIComponent component,
                                  String configVar,
                                  String clientId)

outputFiles

protected String outputFiles(Map map)

outputFiles

protected String outputFiles(List list)

getSize

protected int getSize(Object attchedFiles)

addToolbar

protected String addToolbar(String toolbar)