|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.custom.dojo.DojoUtils
public final class DojoUtils
Utils class for the dojo infrastructure to ease the component building mechanisms note this class uses its own double entries filter due to the fact that we can mix and match header and body scripts as needed (we do not want to lose portal functionality do we?)
Method Summary | |
---|---|
static void |
addDebugConsole(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
adds a debug console to the output this is for helping to debug the dojo system a debug:true is required for this to work properly it will not be set by this method (due to the avoidance of unwanted automatisms causing sideefects) |
static void |
addMainInclude(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String javascriptLocation,
DojoConfig config)
|
static void |
addNamespace(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String namespace,
java.lang.String location)
adds a new namespace location to the mix |
static void |
addProvide(javax.faces.context.FacesContext context,
java.lang.String provided)
adds a dojo provide to the current list of definitions within the header |
static void |
addProvide(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String provided)
adds a dojo provide |
static void |
addRequire(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String required)
adds a dojo require include to our mix of stuff used |
static void |
addRequire(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String[] requires)
convenience method for easier requires handling |
static java.lang.String |
calculateWidgetId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent widget)
|
static java.lang.String |
calculateWidgetVarName(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent widget)
|
static java.lang.String |
calculateWidgetVarName(java.lang.String clientId)
helper method to centralize the widget variable name calculation for our dojo javascript widget init code |
static java.lang.String |
createDebugStatement(java.lang.String stmnt)
creates a debug statement for the debug console |
static java.lang.String |
createDebugStatement(java.lang.String stmnt,
java.lang.String value)
creates a debug statement and a corresponding value for the debug console |
static java.lang.String |
createDojoProvideScript(java.lang.String provided)
helper method which does the proper dojo provide script creation |
static java.lang.String |
createDojoRequireString(java.lang.String required)
helper method for the proper dojo require script creation |
static java.util.Map |
getAttributeMap(javax.faces.context.FacesContext facesContext,
java.lang.String[] attributeNames,
javax.faces.component.UIComponent component)
creates a dojoed attribute map upon the given array of attribute names |
static DojoConfig |
getDjConfigInstance(javax.faces.context.FacesContext context)
Request singleton getter method for the djConfig object |
static java.lang.Boolean |
getExpanded(javax.faces.context.FacesContext facesContext)
getter for the expanded flat |
static boolean |
isInlineScriptSet(javax.faces.context.FacesContext context,
java.lang.String inlineScript)
Inline script set |
static void |
mergeExternalDjConfig(javax.faces.context.FacesContext context,
DojoConfig config)
helper to merge in an external dojo config instance the merge algorithm is that an existing entry is overwritten if a new config entry is set make sure that this is not called too often due to the fact that we do heavy reflection in here |
static java.lang.String |
renderWidgetInitializationCode(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String dojoType,
java.util.Map paramMap)
please, instead of using standard dojo taglib mechanisms use this code for initialisation it will render a clean and proper javascript initialisation instead. |
static java.lang.String |
renderWidgetInitializationCode(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component,
java.lang.String dojoType,
java.lang.String[] attributeNames)
convenience method to render the widget init code automatically for a given component and a set of attribute names |
static java.lang.String |
renderWidgetInitializationCode(javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String dojoType,
java.util.Map paramMap,
java.lang.String clientId,
boolean refId)
same for a given neutral id... |
static void |
setExpanded(javax.faces.context.FacesContext facesContext,
java.lang.Boolean expanded)
if this flag is set to true somewhere before the rendering, the expanded version is loaded otherwise the nonexpanded version is loaded |
static void |
writeDebugStatement(javax.faces.context.ResponseWriter writer,
java.lang.String stmnt)
helper to write out debug statements this is only a convenience method to reduce the code bloat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.Map getAttributeMap(javax.faces.context.FacesContext facesContext, java.lang.String[] attributeNames, javax.faces.component.UIComponent component)
facesContext
- standard faces context used internallyattributeNames
- string array of traversable attribute namescomponent
- the source component with the values set
public static void addDebugConsole(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component) throws java.io.IOException
facesContext
- component
-
java.io.IOException
public static void addMainInclude(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String javascriptLocation, DojoConfig config) throws java.io.IOException
java.io.IOException
public static void addNamespace(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String namespace, java.lang.String location) throws java.io.IOException
facesContext
- the faces context which is used internallycomponent
- the affected componentnamespace
- the namespace which has to be appliedlocation
- the script location
java.io.IOException
public static void addProvide(javax.faces.context.FacesContext context, java.lang.String provided)
context
- the faces context for accessing the resources internallyprovided
- the package with the class provided by this implementationpublic static void addProvide(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String provided) throws java.io.IOException
facesContext
- component
- provided
-
java.io.IOException
public static void addRequire(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String[] requires) throws java.io.IOException
facesContext
- standard faces contextcomponent
- the componentrequires
- an array of requires which is rendered into single dojo.require statements
java.io.IOException
public static void addRequire(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String required) throws java.io.IOException
facesContext
- required
-
java.io.IOException
public static java.lang.String createDebugStatement(java.lang.String stmnt)
stmnt
- the debug message displayed by the debug console
public static java.lang.String createDebugStatement(java.lang.String stmnt, java.lang.String value)
stmnt
- the debug message displayed and given value by the debug
console
public static java.lang.String createDojoProvideScript(java.lang.String provided)
provided
- the provided class name
public static java.lang.String createDojoRequireString(java.lang.String required)
required
- the creation package for the require functionality
public static DojoConfig getDjConfigInstance(javax.faces.context.FacesContext context)
context
-
public static java.lang.Boolean getExpanded(javax.faces.context.FacesContext facesContext)
facesContext
-
public static boolean isInlineScriptSet(javax.faces.context.FacesContext context, java.lang.String inlineScript)
context
- standard faces contextinlineScript
- key to the inline script
public static java.lang.String renderWidgetInitializationCode(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String dojoType, java.util.Map paramMap) throws java.io.IOException
facesContext
- standard faces contextcomponent
- standard componentdojoType
- the dojo type of this componentparamMap
-
java.io.IOException
public static java.lang.String renderWidgetInitializationCode(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, java.lang.String dojoType, java.lang.String[] attributeNames) throws java.io.IOException
facesContext
- component
- dojoType
- attributeNames
-
java.io.IOException
public static java.lang.String renderWidgetInitializationCode(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String dojoType, java.util.Map paramMap, java.lang.String clientId, boolean refId) throws java.io.IOException
dojoType
- paramMap
- clientId
- the referencing id which the widget has to render to (note the
id is enforced the uicomponent does nothing in this case!!!!)refId
- if true the refid is set in the dojo javascript init code if
false no ref is set the false often is needed for containers
which dynamically generated widgets with no referencing div
java.io.IOException
public static java.lang.String calculateWidgetVarName(java.lang.String clientId)
clientId
- the client id upon which the var name has to be generated
public static java.lang.String calculateWidgetId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent widget)
public static java.lang.String calculateWidgetVarName(javax.faces.context.FacesContext context, javax.faces.component.UIComponent widget)
public static void mergeExternalDjConfig(javax.faces.context.FacesContext context, DojoConfig config)
context
- config
- public static void setExpanded(javax.faces.context.FacesContext facesContext, java.lang.Boolean expanded)
facesContext
- context because we again have a full request singleton hereexpanded
- if set to true the expanded version of the dojo scripts are
loaded otherwise the non expanded ones are loadedpublic static void writeDebugStatement(javax.faces.context.ResponseWriter writer, java.lang.String stmnt) throws java.io.IOException
writer
- stmnt
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |