## org.apache.myfaces.custom.tree
Class HtmlTreeNode

    java.lang.Object
      javax.faces.component.UIComponent
          javax.faces.component.UIComponentBase
              javax.faces.component.UICommand
                  javax.faces.component.html.HtmlCommandLink
                      org.apache.myfaces.custom.tree.HtmlTreeNode

All Implemented Interfaces:
  javax.faces.component.ActionSource, javax.faces.component.StateHolder

public class HtmlTreeNode
extends javax.faces.component.html.HtmlCommandLink

Represents a single node of a three. A custom html link component representing the expand/collapse icon is held as a facet named `expandCollapse`.

Version:
  $Revision: 169664 $ $Date: 2005-05-11 13:58:53 -0400 (Wed, 11 May 2005) $
Author:
  Oliver Rossmueller

Field Summary
`static int` `CHILD`
`static int` `CHILD_FIRST`
`static int` `CHILD_LAST`
`static int` `CLOSED`
`static int` `CLOSED_FIRST`
`static int` `CLOSED_LAST`
`static int` `CLOSED_SINGLE`
`static java.lang.String` `COMPONENT_TYPE`
`static int` `EMPTY`
`static java.lang.String` `EXPAND_COLLAPSE_FACET`
`static int` `LINE`
`static int` `OPEN`
`static int` `OPEN_FIRST`
`static int` `OPEN_LAST`
`static int` `OPEN_SINGLE`

Fields inherited from class javax.faces.component.UICommand
`COMPONENT_FAMILY`

Constructor Summary
`HtmlTreeNode()`

Method Summary
`void` `expandPath(int[] translatedPath, int current)`
`HtmlTreeImageCommandLink` `getExpandCollapseCommand(javax.faces.context.FacesContext context)`
`int[]` `getLayout()`
`int` `getLevel()`
`int` `getMaxChildLevel()`
`TreePath` `getPath()`
`protected HtmlTree` `getTree()`
`protected TreeModel` `getTreeModel(javax.faces.context.FacesContext context)`
`java.lang.Object` `getUserObject()`
`boolean` `isExpanded()`
`boolean` `isLeaf(javax.faces.context.FacesContext context)`
`boolean` `isSelected()`
`void` `restoreItemState(HtmlTreeNode node)`
`void` `restoreState(javax.faces.context.FacesContext context, java.lang.Object state)`
`java.lang.Object` `saveState(javax.faces.context.FacesContext context)`
`void` `setExpanded(boolean expanded)`
`void` `setLayout(int[] layout)`
`void` `setLayout(int[] parentLayout, int layout)`
`void` `setPath(TreePath path)`
`void` `setSelected(boolean selected)`
`void` `setUserObject(java.lang.Object userObject)`
`void` `toggleExpanded()`
`void` `toggleSelected()`
`protected static TreePath` `translatePath(int[] path, TreeModel model)`
`protected static int[]` `translatePath(TreePath treePath, TreeModel model)`

Methods inherited from class javax.faces.component.html.HtmlCommandLink

`getAccesskey, getCharset, getCoords, getDir, getHreflang, getLang, getOnblur, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRel, getRev, getShape, getStyle, getStyleClass, getTabindex, getTarget, getTitle, getType, setAccesskey, setCharset, setCoords, setDir, setHreflang, setLang, setOnblur, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRel, setRev, setShape, setStyle, setStyleClass, setTabindex, setTarget, setTitle, setType`

Methods inherited from class javax.faces.component.UICommand
`addActionListener, broadcast, getAction, getActionListener, getActionListeners, getFamily, getValue, isImmediate, queueEvent, removeActionListener, setAction, setActionListener, setImmediate, setValue`

Methods inherited from class javax.faces.component.UIComponentBase

`addFacesListener, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### COMPONENT_TYPE

    public static final java.lang.String COMPONENT_TYPE

See Also:
  Constant Field Values

### EXPAND_COLLAPSE_FACET

    public static final java.lang.String EXPAND_COLLAPSE_FACET

See Also:
  Constant Field Values

### OPEN

    public static final int OPEN

See Also:
  Constant Field Values

### OPEN_FIRST

    public static final int OPEN_FIRST

See Also:
  Constant Field Values

### OPEN_LAST

    public static final int OPEN_LAST

See Also:
  Constant Field Values

### OPEN_SINGLE

    public static final int OPEN_SINGLE

See Also:
  Constant Field Values

### CLOSED

    public static final int CLOSED

See Also:
  Constant Field Values

### CLOSED_FIRST

    public static final int CLOSED_FIRST

See Also:
  Constant Field Values

### CLOSED_LAST

    public static final int CLOSED_LAST

See Also:
  Constant Field Values

### CLOSED_SINGLE

    public static final int CLOSED_SINGLE

See Also:
  Constant Field Values

### CHILD

    public static final int CHILD

See Also:
  Constant Field Values

### CHILD_FIRST

    public static final int CHILD_FIRST

See Also:
  Constant Field Values

### CHILD_LAST

    public static final int CHILD_LAST

See Also:
  Constant Field Values

### LINE

    public static final int LINE

See Also:
  Constant Field Values

### EMPTY

    public static final int EMPTY

See Also:
  Constant Field Values

Constructor Detail

### HtmlTreeNode

    public HtmlTreeNode()

Method Detail

### getLevel

    public int getLevel()

### getMaxChildLevel

    public int getMaxChildLevel()

### getPath

    public TreePath getPath()

### setPath

    public void setPath(TreePath path)

### getUserObject

    public java.lang.Object getUserObject()

### setUserObject

    public void setUserObject(java.lang.Object userObject)

### isExpanded

    public boolean isExpanded()

### setExpanded

    public void setExpanded(boolean expanded)

### toggleExpanded

    public void toggleExpanded()

### isSelected

    public boolean isSelected()

### setSelected

    public void setSelected(boolean selected)

### toggleSelected

    public void toggleSelected()

### getLayout

    public int[] getLayout()

### setLayout

    public void setLayout(int[] layout)

### setLayout

    public void setLayout(int[] parentLayout,
                          int layout)

### getExpandCollapseCommand

    public HtmlTreeImageCommandLink getExpandCollapseCommand(javax.faces.context.FacesContext context)

### saveState

    public java.lang.Object saveState(javax.faces.context.FacesContext context)

### restoreState

    public void restoreState(javax.faces.context.FacesContext context,
                             java.lang.Object state)

### translatePath

    protected static int[] translatePath(TreePath treePath,
                                         TreeModel model)

### translatePath

    protected static TreePath translatePath(int[] path,
                                            TreeModel model)

### getTreeModel

    protected TreeModel getTreeModel(javax.faces.context.FacesContext context)

### getTree

    protected HtmlTree getTree()

### isLeaf

    public boolean isLeaf(javax.faces.context.FacesContext context)

### expandPath

    public void expandPath(int[] translatedPath,
                           int current)

### restoreItemState

    public void restoreItemState(HtmlTreeNode node)