com.infragistics.faces.tree.component
Class TreeNode

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
All Implemented Interfaces:
javax.faces.component.ActionSource, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
HtmlTreeNode

public class TreeNode
extends DataList
implements javax.faces.component.ActionSource, javax.faces.component.ValueHolder

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, one node for each row of the data model.

Emits ActionEvent whenever clicked-on

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



Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String FACET_BOTTOM_PAGER
           
static java.lang.String FACET_TOP_PAGER
           
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from class com.infragistics.faces.shared.component.DataRepeater
DATA_ROW
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TreeNode()
          Constructs a new TreeNode
TreeNode(java.lang.String label)
          Constructs a new TreeNode with the specified label
TreeNode(java.lang.String label, java.lang.String iconUrl, java.lang.String expandedIconUrl)
          Constructs a new TreeNode with the specified label, default icon and expanded icon
 
Method Summary
 void addActionListener(javax.faces.event.ActionListener listener)
           
 void addPageChangeListener(PageChangeListener listener)
          Register a new PageChangeListener which will be notified of PageChangeEvent
 void broadcast(javax.faces.event.FacesEvent event)
           
 javax.faces.el.MethodBinding getAction()
           
 javax.faces.el.MethodBinding getActionListener()
           
 javax.faces.event.ActionListener[] getActionListeners()
           
 javax.faces.component.UIComponent getBottomPager()
          Returns the bottom pager.
 javax.faces.convert.Converter getConverter()
           
 java.lang.String getExpandedIconUrl()
          Returns the URL of the image displayed next to this TreeNode when it is expanded.
 java.lang.String getFamily()
           
 java.lang.String getIconUrl()
          Returns the URL of the default image displayed next to this TreeNode.
 java.lang.Object getLocalValue()
           
 java.lang.String getTooltip()
          Returns the tooltip that is displayed
 javax.faces.component.UIComponent getTopPager()
          Returns the top pager.
 TreeView getTreeView()
          Returns the TreeView this node belongs to
 java.lang.Object getValue()
           
 boolean isBottomPagerRendered()
          Returns the TreeNode's bottom pager visibility.
 boolean isDisabled()
          Returns the state of this node: true if disabled, false otherwise
 boolean isExpanded()
          Returns whether the node is expanded or not
 boolean isImmediate()
           
 boolean isRoot()
          Returns whether the node is a root node or not
 boolean isSelected()
          Returns whether the node is selected or not
 boolean isTopPagerRendered()
          Returns the TreeNode's top pager visibility
 void queueEvent(javax.faces.event.FacesEvent event)
           
 void removeActionListener(javax.faces.event.ActionListener listener)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setAction(javax.faces.el.MethodBinding action)
           
 void setActionListener(javax.faces.el.MethodBinding actionListener)
           
 void setBottomPager(javax.faces.component.UIComponent bottomPager)
          Sets the bottom pager.
 void setBottomPagerRendered(boolean bottomPagerRendered)
          Sets the TreeNode's bottom pager visibility.
 void setConverter(javax.faces.convert.Converter converter)
           
 void setDisabled(boolean disabled)
          Sets the state of this node: true if disabled, false otherwise
 void setExpanded(boolean expanded)
          Sets whether the node is expanded or not
 void setExpandedIconUrl(java.lang.String expandedIconUrl)
          Sets the URL of the image displayed next to this TreeNode when it is expanded.
 void setIconUrl(java.lang.String iconUrl)
          Sets the URL of the default image displayed next to this TreeNode.
 void setImmediate(boolean immediate)
           
 void setSelected(boolean selected)
          Sets whether the node is selected or not
 void setTooltip(java.lang.String tooltip)
          Sets the tooltip that is displayed
 void setTopPager(javax.faces.component.UIComponent topPager)
          Sets the top pager.
 void setTopPagerRendered(boolean topPagerRendered)
          Sets the TreeNode's top pager visibility
 void setValue(java.lang.Object value)
           
 
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, getDataKeyName, getDataKeyValue, getDataSource, getTemplateItems, processUpdates, processValidators, 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

FACET_BOTTOM_PAGER

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

FACET_TOP_PAGER

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

RENDERER_TYPE

public static java.lang.String RENDERER_TYPE
Constructor Detail

TreeNode

public TreeNode()
Constructs a new TreeNode


TreeNode

public TreeNode(java.lang.String label)
Constructs a new TreeNode with the specified label

Parameters:
label -

TreeNode

public TreeNode(java.lang.String label,
                java.lang.String iconUrl,
                java.lang.String expandedIconUrl)
Constructs a new TreeNode with the specified label, default icon and expanded icon

Parameters:
label -
iconUrl -
expandedIconUrl -
Method Detail

addActionListener

public void addActionListener(javax.faces.event.ActionListener listener)
Specified by:
addActionListener in interface javax.faces.component.ActionSource

addPageChangeListener

public void addPageChangeListener(PageChangeListener listener)
Description copied from class: DataList
Register a new PageChangeListener which will be notified of PageChangeEvent

Overrides:
addPageChangeListener in class DataList

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class DataList
Throws:
javax.faces.event.AbortProcessingException

getAction

public javax.faces.el.MethodBinding getAction()
Specified by:
getAction in interface javax.faces.component.ActionSource

getActionListener

public javax.faces.el.MethodBinding getActionListener()
Specified by:
getActionListener in interface javax.faces.component.ActionSource

isBottomPagerRendered

public boolean isBottomPagerRendered()
Returns the TreeNode's bottom pager visibility.

Returns:
boolean

getActionListeners

public javax.faces.event.ActionListener[] getActionListeners()
Specified by:
getActionListeners in interface javax.faces.component.ActionSource

getBottomPager

public javax.faces.component.UIComponent getBottomPager()
Returns the bottom pager. A default pager is provided if none has been explictly defined.


getConverter

public javax.faces.convert.Converter getConverter()
Specified by:
getConverter in interface javax.faces.component.ValueHolder

getFamily

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

getLocalValue

public java.lang.Object getLocalValue()
Specified by:
getLocalValue in interface javax.faces.component.ValueHolder

getTooltip

public java.lang.String getTooltip()
Returns the tooltip that is displayed

Returns:
Returns the tooltip.

isTopPagerRendered

public boolean isTopPagerRendered()
Returns the TreeNode's top pager visibility

Returns:
boolean

getTopPager

public javax.faces.component.UIComponent getTopPager()
Returns the top pager. A default pager is provided if none has been explictly defined.

Returns:
the top pager component

getTreeView

public TreeView getTreeView()
Returns the TreeView this node belongs to

Returns:
the parent TreeView

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface javax.faces.component.ValueHolder

isDisabled

public boolean isDisabled()
Returns the state of this node: true if disabled, false otherwise

Returns:
true || false

isExpanded

public boolean isExpanded()
Returns whether the node is expanded or not

Returns:
true || false

getExpandedIconUrl

public java.lang.String getExpandedIconUrl()
Returns the URL of the image displayed next to this TreeNode when it is expanded.

Returns:
java.lang.String

getIconUrl

public java.lang.String getIconUrl()
Returns the URL of the default image displayed next to this TreeNode.

Returns:
java.lang.String

isImmediate

public boolean isImmediate()
Specified by:
isImmediate in interface javax.faces.component.ActionSource

isRoot

public boolean isRoot()
Returns whether the node is a root node or not

Returns:
boolean value

isSelected

public boolean isSelected()
Returns whether the node is selected or not

Returns:
true || false

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class DataRepeater

removeActionListener

public void removeActionListener(javax.faces.event.ActionListener listener)
Specified by:
removeActionListener in interface javax.faces.component.ActionSource

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 DataList

saveState

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

setAction

public void setAction(javax.faces.el.MethodBinding action)
Specified by:
setAction in interface javax.faces.component.ActionSource

setActionListener

public void setActionListener(javax.faces.el.MethodBinding actionListener)
Specified by:
setActionListener in interface javax.faces.component.ActionSource

setBottomPagerRendered

public void setBottomPagerRendered(boolean bottomPagerRendered)
Sets the TreeNode's bottom pager visibility.

Parameters:
bottomPagerRendered - boolean

setBottomPager

public void setBottomPager(javax.faces.component.UIComponent bottomPager)
Sets the bottom pager.

Parameters:
bottomPager -

setConverter

public void setConverter(javax.faces.convert.Converter converter)
Specified by:
setConverter in interface javax.faces.component.ValueHolder

setDisabled

public void setDisabled(boolean disabled)
Sets the state of this node: true if disabled, false otherwise

Parameters:
disabled -

setExpanded

public void setExpanded(boolean expanded)
Sets whether the node is expanded or not

Parameters:
expanded -

setExpandedIconUrl

public void setExpandedIconUrl(java.lang.String expandedIconUrl)
Sets the URL of the image displayed next to this TreeNode when it is expanded.

Parameters:
expandedIconUrl - String

setIconUrl

public void setIconUrl(java.lang.String iconUrl)
Sets the URL of the default image displayed next to this TreeNode.

Parameters:
iconUrl - String

setImmediate

public void setImmediate(boolean immediate)
Specified by:
setImmediate in interface javax.faces.component.ActionSource

setSelected

public void setSelected(boolean selected)
Sets whether the node is selected or not

Parameters:
selected -

setTooltip

public void setTooltip(java.lang.String tooltip)
Sets the tooltip that is displayed

Parameters:
tooltip - The tooltip to set.

setTopPagerRendered

public void setTopPagerRendered(boolean topPagerRendered)
Sets the TreeNode's top pager visibility

Parameters:
topPagerRendered - boolean

setTopPager

public void setTopPager(javax.faces.component.UIComponent topPager)
Sets the top pager.

Parameters:
topPager -

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface javax.faces.component.ValueHolder