Class HelpTreeAdaptor
- java.lang.Object
-
- com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-
- org.glassfish.admingui.common.help.HelpTreeAdaptor
-
- All Implemented Interfaces:
com.sun.jsftemplating.component.factory.tree.TreeAdaptor
public class HelpTreeAdaptor extends com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
The
HelpTreeAdaptor
implementation must have apublic static HelpTreeAdaptor getInstance(FacesContext, LayoutComponent, UIComponent)
method in order to get access to an instance of theHelpTreeAdaptor
instance.This class is used by
DynamicTreeNodeFactory
.- Author:
- Ken Paulsen ([email protected])
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HelpTreeAdaptor(com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent)
This constructor saves theLayoutComponent
descriptor and theUIComponent
associated with thisTreeAdaptor
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List
getChildTreeNodeObjects(Object nodeObject)
Returns childTOCItem
s for the givenTOCItem
orTOC
model Object.Map<String,jakarta.faces.component.UIComponent>
getFacets(jakarta.faces.component.UIComponent comp, Object nodeObject)
This method returns any facets that should be applied to theTreeNode (comp)
.String
getFactoryClass(Object nodeObject)
This method returns theUIComponent
factory class implementation that should be used to create aTreeNode
for the given tree node model object.Map<String,Object>
getFactoryOptions(Object nodeObject)
This method returns the "options" that should be supplied to the factory that creates theTreeNode
for the given tree node model object.Map
getHandlersByType(jakarta.faces.component.UIComponent comp, Object nodeObject)
Advanced framework feature which provides better handling for things such as expanding TreeNodes, beforeEncode, and other events.String
getId(Object nodeObject)
This method returns theid
for the given tree node model object.static com.sun.jsftemplating.component.factory.tree.TreeAdaptor
getInstance(jakarta.faces.context.FacesContext ctx, com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent)
This method provides access to anHelpTreeAdaptor
instance.void
init()
This method is called shortly aftergetInstance(FacesContext, LayoutComponent, UIComponent)
.
-
-
-
Constructor Detail
-
HelpTreeAdaptor
protected HelpTreeAdaptor(com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent)
This constructor saves the
LayoutComponent
descriptor and theUIComponent
associated with thisTreeAdaptor
. This constructor is used by the getInstance() method.
-
-
Method Detail
-
getInstance
public static com.sun.jsftemplating.component.factory.tree.TreeAdaptor getInstance(jakarta.faces.context.FacesContext ctx, com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent)
This method provides access to an
HelpTreeAdaptor
instance. Each time it is invoked, it returns a new instance.
-
init
public void init()
This method is called shortly after
getInstance(FacesContext, LayoutComponent, UIComponent)
. It provides a place for post-creation initialization to take occur.- Specified by:
init
in interfacecom.sun.jsftemplating.component.factory.tree.TreeAdaptor
- Overrides:
init
in classcom.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-
getChildTreeNodeObjects
public List getChildTreeNodeObjects(Object nodeObject)
Returns child
TOCItem
s for the givenTOCItem
orTOC
model Object. Ifnull
is supplied,null
is returned any otherObject
type will result in anIllegalArgumentException
.
-
getFactoryOptions
public Map<String,Object> getFactoryOptions(Object nodeObject)
This method returns the "options" that should be supplied to the factory that creates the
TreeNode
for the given tree node model object.Some useful options for the standard
TreeNode
component include:- text
- url
- imageURL
- target
- action
- actionListener
- expanded
See Tree / TreeNode component documentation for more details.
-
getId
public String getId(Object nodeObject)
This method returns the
id
for the given tree node model object.
-
getFacets
public Map<String,jakarta.faces.component.UIComponent> getFacets(jakarta.faces.component.UIComponent comp, Object nodeObject)
This method returns any facets that should be applied to the
TreeNode (comp)
. Useful facets for the sunTreeNode
component are: "content" and "image".Facets that already exist on
comp
, or facets that are directly added tocomp
do not need to be returned from this method.This implementation directly adds a "content" and "image" facet and returns
null
from this method.- Parameters:
comp
- The tree nodeUIComponent
.nodeObject
- The (model) object representing the tree node.
-
getHandlersByType
public Map getHandlersByType(jakarta.faces.component.UIComponent comp, Object nodeObject)
Advanced framework feature which provides better handling for things such as expanding TreeNodes, beforeEncode, and other events.
This method should return a
Map
ofList
ofHandler
objects. EachList
in theMap
should be registered under a key that cooresponds to to the "event" in which theHandler
s should be invoked.- Specified by:
getHandlersByType
in interfacecom.sun.jsftemplating.component.factory.tree.TreeAdaptor
- Overrides:
getHandlersByType
in classcom.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-
getFactoryClass
public String getFactoryClass(Object nodeObject)
This method returns the
UIComponent
factory class implementation that should be used to create aTreeNode
for the given tree node model object.This implementation returns the default return value, unless the
nodeObject
represents the root node. In that case it will return a the TreeFactory factory class:com.sun.jsftemplating.component.factory.sun.TreeFactory
- Specified by:
getFactoryClass
in interfacecom.sun.jsftemplating.component.factory.tree.TreeAdaptor
- Overrides:
getFactoryClass
in classcom.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-
-