org.apache.myfaces.trinidadinternal.renderkit.core.xhtml
Class XhtmlUtils

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils

public class XhtmlUtils
extends java.lang.Object

XHTML rendering utilities.


Field Summary
static java.lang.String CORE_LIB
          Library key for the locale lib
 
Constructor Summary
XhtmlUtils()
           
 
Method Summary
static void addLib(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.Object libKey)
           
static java.lang.String escapeJS(java.lang.String inString)
          Handle escaping '/', and single quotes, plus escaping text inside of quotes with just a String for input.
static java.lang.String escapeJS(java.lang.String inString, boolean inQuotes)
          Handle escaping '/', and single quotes, plus escaping text inside of quotes with just a String for input.
static void escapeJS(java.lang.StringBuffer outBuffer, java.lang.String inString)
          Handle escaping '/', and single quotes, plus escaping text inside of quotes.
static void escapeJS(java.lang.StringBuffer outBuffer, java.lang.String inString, boolean inQuotes)
          Handle escaping '/', and single quotes, plus escaping text inside of quotes.
static void escapeJS(java.lang.StringBuffer outBuffer, java.lang.String inString, boolean inQuotes, int escapeCount)
          Handle escaping '/', and single quotes, plus escaping text inside of quotes.
static java.lang.String getChainedJS(java.lang.String evh1, java.lang.String evh2, boolean shortCircuit)
          Return the chained JavaScript
static java.lang.String getCompositeId(java.lang.String baseid, java.lang.String suffix)
          Returns a composite ID based on a base and a suffix.
static java.lang.String getFormattedString(java.lang.String pattern, java.lang.String[] parameters)
           
static java.lang.String getJSIdentifier(java.lang.String clientId)
           
static javax.faces.component.UIComponent getStructuralParent(javax.faces.component.UIComponent component)
          Skip over pure iteration components to find a "structural" parent.
static void registerScriptlet(java.lang.Object key, Scriptlet scriptlet)
          Registers a scriptlet.
static boolean supportsSeparateWindow(org.apache.myfaces.trinidad.context.Agent agent)
          Returns true if the agent has enough support for Trinidad to launch separate windows.
static void writeLibImport(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, java.lang.Object libURL)
          Write out a script element importing a library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_LIB

public static final java.lang.String CORE_LIB
Library key for the locale lib

See Also:
Constant Field Values
Constructor Detail

XhtmlUtils

public XhtmlUtils()
Method Detail

getStructuralParent

public static javax.faces.component.UIComponent getStructuralParent(javax.faces.component.UIComponent component)
Skip over pure iteration components to find a "structural" parent. This code is not guaranteed to work, but will work well enough.

Returns:
a structural parent, or null if none exists

supportsSeparateWindow

public static final boolean supportsSeparateWindow(org.apache.myfaces.trinidad.context.Agent agent)
Returns true if the agent has enough support for Trinidad to launch separate windows. We require both multiple window support and PPR support.


getCompositeId

public static java.lang.String getCompositeId(java.lang.String baseid,
                                              java.lang.String suffix)
Returns a composite ID based on a base and a suffix.


registerScriptlet

public static void registerScriptlet(java.lang.Object key,
                                     Scriptlet scriptlet)
Registers a scriptlet.


addLib

public static void addLib(javax.faces.context.FacesContext context,
                          org.apache.myfaces.trinidad.context.RenderingContext arc,
                          java.lang.Object libKey)
                   throws java.io.IOException
Throws:
java.io.IOException

writeLibImport

public static void writeLibImport(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext arc,
                                  java.lang.Object libURL)
                           throws java.io.IOException
Write out a script element importing a library.

Throws:
java.io.IOException

getChainedJS

public static java.lang.String getChainedJS(java.lang.String evh1,
                                            java.lang.String evh2,
                                            boolean shortCircuit)
Return the chained JavaScript


escapeJS

public static java.lang.String escapeJS(java.lang.String inString)
Handle escaping '/', and single quotes, plus escaping text inside of quotes with just a String for input. If a String in and a String out is all that is required, this version is more efficient if the String does not need to be escaped.


escapeJS

public static java.lang.String escapeJS(java.lang.String inString,
                                        boolean inQuotes)
Handle escaping '/', and single quotes, plus escaping text inside of quotes with just a String for input. If a String in and a String out is all that is required, this version is more efficient if the String does not need to be escaped.


escapeJS

public static void escapeJS(java.lang.StringBuffer outBuffer,
                            java.lang.String inString)
Handle escaping '/', and single quotes, plus escaping text inside of quotes.


escapeJS

public static void escapeJS(java.lang.StringBuffer outBuffer,
                            java.lang.String inString,
                            boolean inQuotes)
Handle escaping '/', and single quotes, plus escaping text inside of quotes.


escapeJS

public static void escapeJS(java.lang.StringBuffer outBuffer,
                            java.lang.String inString,
                            boolean inQuotes,
                            int escapeCount)
Handle escaping '/', and single quotes, plus escaping text inside of quotes.


getJSIdentifier

public static java.lang.String getJSIdentifier(java.lang.String clientId)

getFormattedString

public static java.lang.String getFormattedString(java.lang.String pattern,
                                                  java.lang.String[] parameters)


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.