com.ibm.xsp.renderkit.dojo
Class DojoUtil

java.lang.Object
  extended by com.ibm.xsp.renderkit.dojo.DojoUtil

public class DojoUtil
extends java.lang.Object

Useful utilities for writing out the associated html for building DOJO controls


Constructor Summary
DojoUtil()
           
 
Method Summary
static java.lang.String addComponentDojoAttributes(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.String dojoType, java.util.Map<java.lang.String,java.lang.String> attrs)
          Generate the html for dojo type and dojo attributes,
static java.lang.String addDojoAttributes(javax.faces.context.FacesContext context, FacesDojoComponent component)
          Generate the dojo type and dojo attributes with no dojo type specified
static java.lang.String addDojoAttributes(javax.faces.context.FacesContext context, FacesDojoComponent component, java.lang.String defaultDojoType)
          Generate the dojo type and related attributes where you specify default dojo type
static java.lang.String addDojoAttributes(javax.faces.context.FacesContext context, FacesDojoComponent component, java.lang.String defaultDojoType, java.util.Map<java.lang.String,java.lang.String> extraAttributes)
          Generate the dojo type and related attributes
static void addDojoHtmlAttributes(javax.faces.context.FacesContext context, java.lang.String dojoType, java.util.List<DojoAttribute> attributes, java.util.Map<java.lang.String,java.lang.String> extraAttributes)
          Writes out html for dojotype, dojo attributes and html attributes
static void instanciateDojoComponent(javax.faces.context.FacesContext context, java.lang.String dojoId, java.lang.String dojoType, java.util.List<DojoAttribute> attributes, java.util.Map<java.lang.String,java.lang.String> extraAttributes)
          Writes out script onload to instantiate a DojoComponent.
static boolean isDojoEnabled(javax.faces.context.FacesContext context)
          Is dojo JS library being used
static boolean useDojoParser(javax.faces.context.FacesContext context)
          Generate JavaScript statements for initializing Dojo dijits instead of relying on the Dojo parser
static void writeDojoHtmlAttributesMap(javax.faces.context.FacesContext context, java.util.Map<java.lang.String,java.lang.String> attrs)
          Writes out html for map of attributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DojoUtil

public DojoUtil()
Method Detail

useDojoParser

public static boolean useDojoParser(javax.faces.context.FacesContext context)
Generate JavaScript statements for initializing Dojo dijits instead of relying on the Dojo parser

Parameters:
javax.faces.context.FacesContext -

isDojoEnabled

public static boolean isDojoEnabled(javax.faces.context.FacesContext context)
Is dojo JS library being used

Parameters:
context -
Returns:
true if dojo js library is enabled

addDojoAttributes

public static java.lang.String addDojoAttributes(javax.faces.context.FacesContext context,
                                                 FacesDojoComponent component)
                                          throws java.io.IOException
Generate the dojo type and dojo attributes with no dojo type specified

Parameters:
javax.faces.context.FacesContext -
com.ibm.xsp.dojo.FacesDojoComponent - return dojo type
Throws:
java.io.IOException

addDojoAttributes

public static java.lang.String addDojoAttributes(javax.faces.context.FacesContext context,
                                                 FacesDojoComponent component,
                                                 java.lang.String defaultDojoType)
                                          throws java.io.IOException
Generate the dojo type and related attributes where you specify default dojo type

Parameters:
javax.faces.context.FacesContext -
com.ibm.xsp.dojo.FacesDojoComponent -
default - dojo type return dojo type
Throws:
java.io.IOException

addDojoAttributes

public static java.lang.String addDojoAttributes(javax.faces.context.FacesContext context,
                                                 FacesDojoComponent component,
                                                 java.lang.String defaultDojoType,
                                                 java.util.Map<java.lang.String,java.lang.String> extraAttributes)
                                          throws java.io.IOException
Generate the dojo type and related attributes

Parameters:
javax.faces.context.FacesContext -
com.ibm.xsp.dojo.FacesDojoComponent -
default - dojo type
java.util.Map - attributes return dojo type
Throws:
java.io.IOException

addComponentDojoAttributes

public static java.lang.String addComponentDojoAttributes(javax.faces.context.FacesContext context,
                                                          javax.faces.component.UIComponent component,
                                                          java.lang.String dojoType,
                                                          java.util.Map<java.lang.String,java.lang.String> attrs)
                                                   throws java.io.IOException
Generate the html for dojo type and dojo attributes,

Parameters:
javax.faces.context.FacesContext -
com.ibm.xsp.dojo.FacesDojoComponent -
default - dojo type
java.util.Map - attributes return dojo type
Throws:
java.io.IOException

addDojoHtmlAttributes

public static void addDojoHtmlAttributes(javax.faces.context.FacesContext context,
                                         java.lang.String dojoType,
                                         java.util.List<DojoAttribute> attributes,
                                         java.util.Map<java.lang.String,java.lang.String> extraAttributes)
                                  throws java.io.IOException
Writes out html for dojotype, dojo attributes and html attributes

Parameters:
javax.faces.context.FacesContext -
dojo - type
java.util.List - Dojo Attributes
java.util.Map - HTML Attributes
Throws:
java.io.IOException

writeDojoHtmlAttributesMap

public static void writeDojoHtmlAttributesMap(javax.faces.context.FacesContext context,
                                              java.util.Map<java.lang.String,java.lang.String> attrs)
                                       throws java.io.IOException
Writes out html for map of attributes

Parameters:
javax.faces.context.FacesContext -
java.util.Map -
Throws:
java.io.IOException

instanciateDojoComponent

public static void instanciateDojoComponent(javax.faces.context.FacesContext context,
                                            java.lang.String dojoId,
                                            java.lang.String dojoType,
                                            java.util.List<DojoAttribute> attributes,
                                            java.util.Map<java.lang.String,java.lang.String> extraAttributes)
                                     throws java.io.IOException
Writes out script onload to instantiate a DojoComponent.

Parameters:
javax.faces.context.FacesContext -
dojo - Id
dojoType -
dojoAttribute - attributes
Throws:
java.io.IOException