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

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.trinidad.render.CoreRenderer
          extended by org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer
              extended by org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.TreeRenderer
All Implemented Interfaces:
java.lang.Cloneable, org.apache.myfaces.trinidad.render.TypedRenderer

public class TreeRenderer
extends XhtmlRenderer

Renderer for trees.


Field Summary
protected static int EXPAND_ALWAYS
           
protected static int EXPAND_CLOSED
           
protected static int EXPAND_OPEN
           
protected static int NO_CHILDREN
           
static java.lang.String NODE_ICON_COLLAPSED_SUFFIX
           
static java.lang.String NODE_ICON_EXPANDED_SUFFIX
           
static java.lang.String SELECTED_PARAM
           
 
Fields inherited from class org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer
TRANSPARENT_GIF
 
Fields inherited from class org.apache.myfaces.trinidad.render.CoreRenderer
CHAR_UNDEFINED, NO_CHILD_INDEX
 
Constructor Summary
  TreeRenderer()
           
protected TreeRenderer(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
           
 
Method Summary
protected  void decode(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean facesBean, java.lang.String clientId)
           
protected  void encodeAll(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  void findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
           
protected  java.lang.String getConnectingBackgroundIcon(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, boolean isLine, boolean leftToRight)
          Returns the URI of the vertical line icon
protected  java.lang.String getDefaultIconName()
           
protected  org.apache.myfaces.trinidad.model.RowKeySet getExpandedRowKeys(org.apache.myfaces.trinidad.component.UIXHierarchy tree)
           
protected  java.lang.String getIconBackgroundIcon(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, boolean isLastSibling, boolean isLeftToRight)
          Returns the URI of the expanded-icon's background icon Usually the lines connecting a node
protected  boolean getImmediate(javax.faces.component.UIComponent component, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  org.apache.myfaces.trinidad.skin.Icon getNodeIcon(org.apache.myfaces.trinidad.context.RenderingContext rc, java.lang.String nodeType, int expandedState)
           
protected  java.lang.String getNodeIconSelector(java.lang.String nodeType, int expandedState)
           
protected  java.lang.String getNodeType(org.apache.myfaces.trinidad.component.UIXHierarchy tree)
           
 boolean getRendersChildren()
           
protected  java.util.Map<java.lang.Object,java.lang.Boolean> getSelectedPaths(java.lang.Object focusPath)
           
protected  boolean isShowLines(org.apache.myfaces.trinidad.context.RenderingContext rc)
          Returns true if the tree connecting lines should be rendered
protected  void renderExpandCell(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXHierarchy tree, int expanded, boolean isLastSibling, java.lang.String onclick)
           
protected  void renderExpandIconCell(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, java.lang.String backgroundIcon, java.lang.String nodeBackgroundIcon, java.lang.String icon, boolean isIconAbsoluteURI, java.lang.Object altText, java.lang.String width, java.lang.String height, java.lang.String onclick)
           
protected  void renderIconCell(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXHierarchy tree, java.lang.String backgroundIcon, java.lang.String icon, boolean isIconAbsoluteURI, java.lang.Object altText, java.lang.String width, java.lang.String height, java.lang.String onclick)
           
protected  void renderNodeIconCell(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXHierarchy tree, int expand)
           
protected  void renderStampCell(javax.faces.context.FacesContext context, org.apache.myfaces.trinidad.context.RenderingContext rc, org.apache.myfaces.trinidad.component.UIXHierarchy tree, javax.faces.component.UIComponent stamp, java.lang.String onClick, java.lang.String treeStyle, int nodeDepth)
           
protected  boolean setInitialPath(org.apache.myfaces.trinidad.component.UIXHierarchy tree, org.apache.myfaces.trinidad.bean.FacesBean bean)
           
protected  boolean shouldRenderId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Returns true if the component should render an ID.
 
Methods inherited from class org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlRenderer
canSkipRendering, canSkipRendering, cloneWithType, getAbsoluteImageUri, getBaseImageUri, getDefaultStyleClass, getInlineStyle, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getPartialTriggers, getShortDesc, getStyleClass, renderAllAttributes, renderAllAttributes, renderDecorativeIcon, renderDecorativeIcon, renderEventHandlers, renderFormattedText, renderHAlign, renderInlineStyle, renderInlineStyleAttribute, renderPossiblyFormattedText, renderScriptDeferAttribute, renderScriptTypeAttribute, renderShortDescAttribute, renderSpacer, renderStyleAttributes, renderStyleAttributes, renderSubmitButtonNonJSBrowser, renderTransparent, renderVerticalSpacer, resolveProperty, resolveProperty, skipDecode, supportsAccessKeys, supportsAdvancedForms, supportsAutoCompleteFormElements, supportsDisabledFormElements, supportsEditing, supportsIntrinsicEvents, supportsNarrowScreen, supportsNavigation, supportsOnClickOnImgInput, supportsReadonlyFormElements, supportsScripting, supportsSeparateWindow, supportsStyleAttributes, supportsTarget, supportsTextPresentation
 
Methods inherited from class org.apache.myfaces.trinidad.render.CoreRenderer
afterEncode, beforeEncode, decode, decodeBehaviors, delegateRenderer, delegateRendererBegin, delegateRendererEnd, encodeAllChildren, encodeBegin, encodeBegin, encodeChild, encodeChildren, encodeComponentResources, encodeEnd, encodeEnd, getBehaviorParameters, getClientId, getFacesBean, getFacet, getNextRenderedChildIndex, getRenderedChildCount, getRenderedFacetsAndChildren, getRenderingProperty, hasRenderedChildren, isDesktop, isGecko, isGenericPDA, isIE, isInaccessibleMode, isIPhone, isKonqueror, isNokiaS60, isOpera, isPDA, isScreenReaderMode, isWebKit, partialEncodeVisit, renderEncodedActionURI, renderEncodedResourceURI, renderId, renderStyleClass, renderStyleClasses, setRenderingProperty, setupChildrenEncodingContext, setupEncodingContext, setupEncodingContext, tearDownChildrenEncodingContext, tearDownEncodingContext, tearDownEncodingContext, toActionUri, toChar, toInt, toLong, toResourceUri, toString, toUri, visitChildrenForEncoding
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHILDREN

protected static final int NO_CHILDREN
See Also:
Constant Field Values

EXPAND_CLOSED

protected static final int EXPAND_CLOSED
See Also:
Constant Field Values

EXPAND_OPEN

protected static final int EXPAND_OPEN
See Also:
Constant Field Values

EXPAND_ALWAYS

protected static final int EXPAND_ALWAYS
See Also:
Constant Field Values

SELECTED_PARAM

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

NODE_ICON_EXPANDED_SUFFIX

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

NODE_ICON_COLLAPSED_SUFFIX

public static final java.lang.String NODE_ICON_COLLAPSED_SUFFIX
See Also:
Constant Field Values
Constructor Detail

TreeRenderer

public TreeRenderer()

TreeRenderer

protected TreeRenderer(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
Method Detail

findTypeConstants

protected void findTypeConstants(org.apache.myfaces.trinidad.bean.FacesBean.Type type)
Overrides:
findTypeConstants in class XhtmlRenderer

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.render.Renderer

decode

protected void decode(javax.faces.context.FacesContext facesContext,
                      javax.faces.component.UIComponent component,
                      org.apache.myfaces.trinidad.bean.FacesBean facesBean,
                      java.lang.String clientId)
Overrides:
decode in class org.apache.myfaces.trinidad.render.CoreRenderer

encodeAll

protected void encodeAll(javax.faces.context.FacesContext context,
                         org.apache.myfaces.trinidad.context.RenderingContext rc,
                         javax.faces.component.UIComponent component,
                         org.apache.myfaces.trinidad.bean.FacesBean bean)
                  throws java.io.IOException
Overrides:
encodeAll in class org.apache.myfaces.trinidad.render.CoreRenderer
Throws:
java.io.IOException

shouldRenderId

protected boolean shouldRenderId(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component)
Description copied from class: XhtmlRenderer
Returns true if the component should render an ID. Components that deliver events should always return "true".

Overrides:
shouldRenderId in class XhtmlRenderer

setInitialPath

protected boolean setInitialPath(org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                 org.apache.myfaces.trinidad.bean.FacesBean bean)

getSelectedPaths

protected java.util.Map<java.lang.Object,java.lang.Boolean> getSelectedPaths(java.lang.Object focusPath)

getExpandedRowKeys

protected org.apache.myfaces.trinidad.model.RowKeySet getExpandedRowKeys(org.apache.myfaces.trinidad.component.UIXHierarchy tree)

isShowLines

protected boolean isShowLines(org.apache.myfaces.trinidad.context.RenderingContext rc)
Returns true if the tree connecting lines should be rendered

Parameters:
rc - the RenderingContext
Returns:
the value of the AF_TREE_SHOW_LINES skin property

getConnectingBackgroundIcon

protected java.lang.String getConnectingBackgroundIcon(javax.faces.context.FacesContext context,
                                                       org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                       boolean isLine,
                                                       boolean leftToRight)
Returns the URI of the vertical line icon

Parameters:
context - the FacesContext
rc - the RenderingContext
isLine - if there is need for a vertical line
leftToRight - left to right
Returns:
the URI of the icon

getIconBackgroundIcon

protected java.lang.String getIconBackgroundIcon(javax.faces.context.FacesContext context,
                                                 org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                 boolean isLastSibling,
                                                 boolean isLeftToRight)
Returns the URI of the expanded-icon's background icon Usually the lines connecting a node

Parameters:
context - the FacesContext
rc - the RenderingContext
isLastSibling - true if the node is the last child of its parent node
isLeftToRight - left to right
Returns:
the URI of the icon

renderExpandCell

protected void renderExpandCell(javax.faces.context.FacesContext context,
                                org.apache.myfaces.trinidad.context.RenderingContext rc,
                                org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                int expanded,
                                boolean isLastSibling,
                                java.lang.String onclick)
                         throws java.io.IOException
Throws:
java.io.IOException

renderExpandIconCell

protected void renderExpandIconCell(javax.faces.context.FacesContext context,
                                    org.apache.myfaces.trinidad.context.RenderingContext rc,
                                    java.lang.String backgroundIcon,
                                    java.lang.String nodeBackgroundIcon,
                                    java.lang.String icon,
                                    boolean isIconAbsoluteURI,
                                    java.lang.Object altText,
                                    java.lang.String width,
                                    java.lang.String height,
                                    java.lang.String onclick)
                             throws java.io.IOException
Throws:
java.io.IOException

renderIconCell

protected void renderIconCell(javax.faces.context.FacesContext context,
                              org.apache.myfaces.trinidad.context.RenderingContext rc,
                              org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                              java.lang.String backgroundIcon,
                              java.lang.String icon,
                              boolean isIconAbsoluteURI,
                              java.lang.Object altText,
                              java.lang.String width,
                              java.lang.String height,
                              java.lang.String onclick)
                       throws java.io.IOException
Throws:
java.io.IOException

renderNodeIconCell

protected void renderNodeIconCell(javax.faces.context.FacesContext context,
                                  org.apache.myfaces.trinidad.context.RenderingContext rc,
                                  org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                                  int expand)
                           throws java.io.IOException
Throws:
java.io.IOException

getNodeType

protected java.lang.String getNodeType(org.apache.myfaces.trinidad.component.UIXHierarchy tree)

getNodeIconSelector

protected java.lang.String getNodeIconSelector(java.lang.String nodeType,
                                               int expandedState)

getNodeIcon

protected org.apache.myfaces.trinidad.skin.Icon getNodeIcon(org.apache.myfaces.trinidad.context.RenderingContext rc,
                                                            java.lang.String nodeType,
                                                            int expandedState)

renderStampCell

protected void renderStampCell(javax.faces.context.FacesContext context,
                               org.apache.myfaces.trinidad.context.RenderingContext rc,
                               org.apache.myfaces.trinidad.component.UIXHierarchy tree,
                               javax.faces.component.UIComponent stamp,
                               java.lang.String onClick,
                               java.lang.String treeStyle,
                               int nodeDepth)
                        throws java.io.IOException
Throws:
java.io.IOException

getImmediate

protected boolean getImmediate(javax.faces.component.UIComponent component,
                               org.apache.myfaces.trinidad.bean.FacesBean bean)

getDefaultIconName

protected java.lang.String getDefaultIconName()


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