org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.table
Class TreeUtils

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

public final class TreeUtils
extends java.lang.Object

Class that handles all tree related events


Field Summary
static java.lang.String EVENT_PARAM
           
static java.lang.String SOURCE_PARAM
           
 
Method Summary
static java.lang.String callJSExpandAll(org.apache.myfaces.trinidad.component.UIXHierarchy tree, java.lang.String jsVarName, boolean isExpand)
           
static java.lang.String callJSExpandNode(org.apache.myfaces.trinidad.component.UIXHierarchy tree, java.lang.String jsVarName, boolean isExpand)
           
static java.lang.String callJSFocusNode(org.apache.myfaces.trinidad.component.UIXHierarchy tree, java.lang.String jsVarName)
           
static java.lang.String callJSGotoNode(org.apache.myfaces.trinidad.component.UIXHierarchy tree, java.lang.String jsVarName, int rangeStart)
           
static java.lang.String callJSSelectAll(java.lang.String jsVarName, boolean isSelectAll)
           
static java.lang.String createNewJSCollectionComponentState(java.lang.String formName, java.lang.String treeClientId)
           
static void decodeExpandEvents(java.util.Map<java.lang.String,java.lang.String> parameters, javax.faces.component.UIComponent tree, java.lang.Object focusRowKey)
           
static void decodeFocusEvent(java.util.Map<java.lang.String,java.lang.String> parameters, javax.faces.component.UIComponent tree)
           
static void decodeGotoEvent(java.util.Map<java.lang.String,java.lang.String> parameters, javax.faces.component.UIComponent tree)
           
static void expandFocusRowKey(org.apache.myfaces.trinidad.component.UIXTree tree)
          Utility method to expand the focusRowKey during initial rendering.
static java.lang.String getFocusNodeClientId(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.component.UIXHierarchy tree)
          Returns tree focus node client id if any node is focused.
static java.lang.Object getFocusRowKey(org.apache.myfaces.trinidad.component.UIXTreeTable treeTable)
           
static java.lang.String renderEncodedNameAttri(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXHierarchy tree, java.lang.String treeName, boolean isExpand)
          Returns String object containing encoded parameter name and value pair for Non-JavaScript browsers.
static void setDefaultFocusRowKey(org.apache.myfaces.trinidad.component.UIXTree tree)
          Utility method to default the focusRowKey to the root node, if it is not set
static java.lang.String setupJSMultiSelectCollectionComponent(java.lang.String selectedKey, java.lang.String selectedModeKey, boolean autoSubmit)
           
static java.lang.String setupJSTreeCollectionComponent(boolean validate)
           
static java.lang.StringBuffer setupTreeCollectionComponent(java.lang.StringBuffer buff, boolean validate)
          writes the JS function needed for generating tree events.
static void writeNodeLevel(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext arc, int depth, java.lang.String nodeLevelTextKey)
          This method is used for writing the depth of node from it's root in the case tree and HGrid, thus making it more accessible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_PARAM

public static final java.lang.String EVENT_PARAM
See Also:
Constant Field Values

SOURCE_PARAM

public static final java.lang.String SOURCE_PARAM
See Also:
Constant Field Values
Method Detail

writeNodeLevel

public static void writeNodeLevel(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext arc,
                                  int depth,
                                  java.lang.String nodeLevelTextKey)
                           throws java.io.IOException
This method is used for writing the depth of node from it's root in the case tree and HGrid, thus making it more accessible.

Throws:
java.io.IOException

getFocusRowKey

public static java.lang.Object getFocusRowKey(org.apache.myfaces.trinidad.component.UIXTreeTable treeTable)

getFocusNodeClientId

public static java.lang.String getFocusNodeClientId(javax.faces.context.FacesContext context,
                                                    org.apache.myfaces.trinidad.component.UIXHierarchy tree)
Returns tree focus node client id if any node is focused. Otherwise it returns null.

Parameters:
context - faces context
tree - tree component
Returns:
focus node client id

expandFocusRowKey

public static void expandFocusRowKey(org.apache.myfaces.trinidad.component.UIXTree tree)
Utility method to expand the focusRowKey during initial rendering.

Parameters:
tree -

setDefaultFocusRowKey

public static void setDefaultFocusRowKey(org.apache.myfaces.trinidad.component.UIXTree tree)
Utility method to default the focusRowKey to the root node, if it is not set

Parameters:
tree -

setupTreeCollectionComponent

public static java.lang.StringBuffer setupTreeCollectionComponent(java.lang.StringBuffer buff,
                                                                  boolean validate)
writes the JS function needed for generating tree events.

Parameters:
buff - the function source is appended to this buffer
Returns:

setupJSTreeCollectionComponent

public static java.lang.String setupJSTreeCollectionComponent(boolean validate)

setupJSMultiSelectCollectionComponent

public static java.lang.String setupJSMultiSelectCollectionComponent(java.lang.String selectedKey,
                                                                     java.lang.String selectedModeKey,
                                                                     boolean autoSubmit)

createNewJSCollectionComponentState

public static java.lang.String createNewJSCollectionComponentState(java.lang.String formName,
                                                                   java.lang.String treeClientId)

callJSExpandNode

public static java.lang.String callJSExpandNode(org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                                java.lang.String jsVarName,
                                                boolean isExpand)

callJSGotoNode

public static java.lang.String callJSGotoNode(org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                              java.lang.String jsVarName,
                                              int rangeStart)

callJSFocusNode

public static java.lang.String callJSFocusNode(org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                               java.lang.String jsVarName)

callJSExpandAll

public static java.lang.String callJSExpandAll(org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                               java.lang.String jsVarName,
                                               boolean isExpand)

callJSSelectAll

public static java.lang.String callJSSelectAll(java.lang.String jsVarName,
                                               boolean isSelectAll)

decodeGotoEvent

public static void decodeGotoEvent(java.util.Map<java.lang.String,java.lang.String> parameters,
                                   javax.faces.component.UIComponent tree)

decodeFocusEvent

public static void decodeFocusEvent(java.util.Map<java.lang.String,java.lang.String> parameters,
                                    javax.faces.component.UIComponent tree)

decodeExpandEvents

public static void decodeExpandEvents(java.util.Map<java.lang.String,java.lang.String> parameters,
                                      javax.faces.component.UIComponent tree,
                                      java.lang.Object focusRowKey)

renderEncodedNameAttri

public static java.lang.String renderEncodedNameAttri(javax.faces.context.FacesContext context,
                                                      org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                      org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                                      java.lang.String treeName,
                                                      boolean isExpand)
                                               throws java.io.IOException
Returns String object containing encoded parameter name and value pair for Non-JavaScript browsers.

Throws:
java.io.IOException


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.