com.infragistics.faces.tree.component.html
Class HtmlTreeNode

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended bycom.infragistics.faces.shared.component.DataRepeater
              extended bycom.infragistics.faces.shared.component.DataList
                  extended bycom.infragistics.faces.tree.component.TreeNode
                      extended bycom.infragistics.faces.tree.component.html.HtmlTreeNode
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class HtmlTreeNode
extends TreeNode

Represents an individual tree node that can contain nested tree nodes to represent hierarchical information.

Bound and unbound mode
Just like trees, tree nodes support bound as well as unbound mode. In unbound mode, tree nodes are created declaratively (in a JSP page) or added programmatically.
In bound mode (whenever the dataModel property points to a valid data model of a backing bean) tree nodes are automatically added to the parent component, one node for each row of the data model.

Look and Feel
The look and feel of each tree node can be individually defined.
TreeNode's default appearance, hover appearance and selected appearance can be specified by calling setStyle(String), setHoverStyleClass(String) and setSelectedStyleClass(String).
The default icon of a node and the icon displayed whenever a node is expanded can be specified by calling TreeNode.setIconUrl(String) and TreeNode.setExpandedIconUrl(String).
The collapsed/expanded state of a node can be modified by calling TreeNode.setExpanded(boolean)

The table below summarizes which elements can be customized:

Style applied to How to customize it ?
Node Using setStyle(String) and/or setStyleClass(String).
Hovered Node Using setHoverStyleClass(String).
Selected Node Using setSelectedStyleClass(String).

Facets

The following facets can be nested inside the component:
Facet Name Description
bottomPager Specifies the bottom pager to use
topPager Specifies the top pager to use

Events


TreeNode fires the following event:


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from class com.infragistics.faces.tree.component.TreeNode
FACET_BOTTOM_PAGER, FACET_TOP_PAGER
 
Fields inherited from class com.infragistics.faces.shared.component.DataRepeater
DATA_ROW
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
HtmlTreeNode()
           
HtmlTreeNode(java.lang.String label)
           
HtmlTreeNode(java.lang.String label, java.lang.String icon, java.lang.String expandedIcon)
           
 
Method Summary
 java.lang.String getFamily()
           
 java.lang.String getHoverStyleClass()
          Returns the name of the css class applied to the component when the mouse is over it
 java.lang.String getHref()
          Returns the href (url) to navigate-to whenever the user clicks on the command If both action and href are specified, href is used
 java.lang.String getSelectedStyleClass()
          Returns the name of the css class applied to this node whenever selected
 java.lang.String getStyle()
          Returns the default Style applied to the component
 java.lang.String getStyleClass()
          Returns the name of the css class applied to the component
 java.lang.String getTarget()
          Returns the target frame and/or window that will receive the result of this action
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setHoverStyleClass(java.lang.String hoverClass)
          Sets the name of the css class applied to the component when the mouse cursor is over it
 void setHref(java.lang.String href)
          Sets the href (url) to navigate-to whenever the node is clicked-on
 void setSelectedStyleClass(java.lang.String selectedClass)
          Sets the name of the css class applied to this node when selected
 void setStyle(java.lang.String style)
          Sets the default style applied to the component
 void setStyleClass(java.lang.String cssClass)
          Sets the name of the css class applied to the component
 void setTarget(java.lang.String target)
          Sets the target frame and/or window that will receive the result of this action
 
Methods inherited from class com.infragistics.faces.tree.component.TreeNode
addActionListener, addPageChangeListener, broadcast, getAction, getActionListener, getActionListeners, getBottomPager, getConverter, getExpandedIconUrl, getIconUrl, getLocalValue, getTooltip, getTopPager, getTreeView, getValue, isBottomPagerRendered, isDisabled, isExpanded, isImmediate, isRoot, isSelected, isTopPagerRendered, queueEvent, removeActionListener, setAction, setActionListener, setBottomPager, setBottomPagerRendered, setConverter, setDisabled, setExpanded, setExpandedIconUrl, setIconUrl, setImmediate, setSelected, setTooltip, setTopPager, setTopPagerRendered, setValue
 
Methods inherited from class com.infragistics.faces.shared.component.DataList
addSortListener, firePageChangeEvent, fireSortEvent, getItemCount, getPageChangeListener, getPageChangeListeners, getPageCount, getPageIndex, getPageSize, getSortExpressionIndex, getSortExpressions, getSortListener, getSortListeners, isCustomPagingEnabled, isCustomSortingEnabled, removePageChangeListener, removeSortListener, setCustomPagingEnabled, setCustomSortingEnabled, setItemCount, setPageChangeListener, setPageIndex, setPageSize, setSortExpressions, setSortListener
 
Methods inherited from class com.infragistics.faces.shared.component.DataRepeater
dataBind, encodeBegin, encodeEnd, export, getDataKeyName, getDataKeyValue, getDataSource, getTemplateItems, popDataRow, processUpdates, processValidators, pushDataRow, setDataKeyName, setDataSource, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponentBase
decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static java.lang.String COMPONENT_FAMILY

COMPONENT_TYPE

public static java.lang.String COMPONENT_TYPE

RENDERER_TYPE

public static java.lang.String RENDERER_TYPE
Constructor Detail

HtmlTreeNode

public HtmlTreeNode()

HtmlTreeNode

public HtmlTreeNode(java.lang.String label)
Parameters:
label -

HtmlTreeNode

public HtmlTreeNode(java.lang.String label,
                    java.lang.String icon,
                    java.lang.String expandedIcon)
Parameters:
label -
icon -
expandedIcon -
Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class TreeNode

getHoverStyleClass

public java.lang.String getHoverStyleClass()
Returns the name of the css class applied to the component when the mouse is over it

Returns:
the name of the hover class

getHref

public java.lang.String getHref()
Returns the href (url) to navigate-to whenever the user clicks on the command If both action and href are specified, href is used

Returns:
the href property

getSelectedStyleClass

public java.lang.String getSelectedStyleClass()
Returns the name of the css class applied to this node whenever selected

Returns:
the name of the selected class

getStyle

public java.lang.String getStyle()
Returns the default Style applied to the component

Returns:
the style

getStyleClass

public java.lang.String getStyleClass()
Returns the name of the css class applied to the component

Returns:
the name of the css class

getTarget

public java.lang.String getTarget()
Returns the target frame and/or window that will receive the result of this action

Returns:
the target property

setHoverStyleClass

public void setHoverStyleClass(java.lang.String hoverClass)
Sets the name of the css class applied to the component when the mouse cursor is over it

Parameters:
hoverClass -

setHref

public void setHref(java.lang.String href)
Sets the href (url) to navigate-to whenever the node is clicked-on

Parameters:
href -

setSelectedStyleClass

public void setSelectedStyleClass(java.lang.String selectedClass)
Sets the name of the css class applied to this node when selected

Parameters:
selectedClass -

setStyle

public void setStyle(java.lang.String style)
Sets the default style applied to the component

Parameters:
style -

setStyleClass

public void setStyleClass(java.lang.String cssClass)
Sets the name of the css class applied to the component

Parameters:
cssClass - : the name of the new css class

setTarget

public void setTarget(java.lang.String target)
Sets the target frame and/or window that will receive the result of this action

Parameters:
target - the target property

restoreState

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

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class TreeNode