org.apache.myfaces.custom.tree
Class HtmlTreeNode

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by javax.faces.component.html.HtmlCommandLink
                  extended by 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: 659874 $ $Date: 2008-05-24 15:59:15 -0500 (Sat, 24 May 2008) $
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 String COMPONENT_TYPE
           
static int EMPTY
           
static 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)
           
 org.apache.myfaces.custom.tree.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)
           
 Object getUserObject()
           
 boolean isExpanded()
           
 boolean isLeaf(javax.faces.context.FacesContext context)
           
 boolean isSelected()
           
 void restoreItemState(HtmlTreeNode node)
           
 void restoreState(javax.faces.context.FacesContext context, Object state)
           
 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(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 String COMPONENT_TYPE
See Also:
Constant Field Values

EXPAND_COLLAPSE_FACET

public static final 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 Object getUserObject()

setUserObject

public void setUserObject(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 org.apache.myfaces.custom.tree.HtmlTreeImageCommandLink getExpandCollapseCommand(javax.faces.context.FacesContext context)

saveState

public Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.html.HtmlCommandLink

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.html.HtmlCommandLink

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)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.