Class HelpTreeAdaptor
- All Implemented Interfaces:
com.sun.jsftemplating.component.factory.tree.TreeAdaptor
The HelpTreeAdaptor implementation must have a
public static HelpTreeAdaptor getInstance(FacesContext,
LayoutComponent, UIComponent) method in order to get access to
an instance of the HelpTreeAdaptor instance.
This class is used by DynamicTreeNodeFactory.
- Author:
- Ken Paulsen (ken.paulsen@sun.com)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHelpTreeAdaptor(com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent) This constructor saves theLayoutComponentdescriptor and theUIComponentassociated with thisTreeAdaptor. -
Method Summary
Modifier and TypeMethodDescriptiongetChildTreeNodeObjects(Object nodeObject) Returns childTOCItems for the givenTOCItemorTOCmodel Object.This method returns any facets that should be applied to theTreeNode (comp).getFactoryClass(Object nodeObject) This method returns theUIComponentfactory class implementation that should be used to create aTreeNodefor the given tree node model object.getFactoryOptions(Object nodeObject) This method returns the "options" that should be supplied to the factory that creates theTreeNodefor the given tree node model object.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 returns theidfor the given tree node model object.static com.sun.jsftemplating.component.factory.tree.TreeAdaptorgetInstance(jakarta.faces.context.FacesContext ctx, com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent) This method provides access to anHelpTreeAdaptorinstance.voidinit()This method is called shortly aftergetInstance(FacesContext, LayoutComponent, UIComponent).Methods inherited from class com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
getFacets, getLayoutComponent, getParentUIComponent, getTreeNodeObject, setLayoutComponent, setParentUIComponent, setTreeNodeObject
-
Constructor Details
-
HelpTreeAdaptor
protected HelpTreeAdaptor(com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, jakarta.faces.component.UIComponent parent) This constructor saves the
LayoutComponentdescriptor and theUIComponentassociated with thisTreeAdaptor. This constructor is used by the getInstance() method.
-
-
Method Details
-
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
HelpTreeAdaptorinstance. 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:
initin interfacecom.sun.jsftemplating.component.factory.tree.TreeAdaptor- Overrides:
initin classcom.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-
getChildTreeNodeObjects
Returns child
TOCItems for the givenTOCItemorTOCmodel Object. Ifnullis supplied,nullis returned any otherObjecttype will result in anIllegalArgumentException. -
getFactoryOptions
This method returns the "options" that should be supplied to the factory that creates the
TreeNodefor the given tree node model object.Some useful options for the standard
TreeNodecomponent include:- text
- url
- imageURL
- target
- action
- actionListener
- expanded
See Tree / TreeNode component documentation for more details.
-
getId
This method returns the
idfor 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 sunTreeNodecomponent are: "content" and "image".Facets that already exist on
comp, or facets that are directly added tocompdo not need to be returned from this method.This implementation directly adds a "content" and "image" facet and returns
nullfrom this method.- Parameters:
comp- The tree nodeUIComponent.nodeObject- The (model) object representing the tree node.
-
getHandlersByType
Advanced framework feature which provides better handling for things such as expanding TreeNodes, beforeEncode, and other events.
This method should return a
MapofListofHandlerobjects. EachListin theMapshould be registered under a key that cooresponds to to the "event" in which theHandlers should be invoked.- Specified by:
getHandlersByTypein interfacecom.sun.jsftemplating.component.factory.tree.TreeAdaptor- Overrides:
getHandlersByTypein classcom.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-
getFactoryClass
This method returns the
UIComponentfactory class implementation that should be used to create aTreeNodefor the given tree node model object.This implementation returns the default return value, unless the
nodeObjectrepresents the root node. In that case it will return a the TreeFactory factory class:com.sun.jsftemplating.component.factory.sun.TreeFactory
- Specified by:
getFactoryClassin interfacecom.sun.jsftemplating.component.factory.tree.TreeAdaptor- Overrides:
getFactoryClassin classcom.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
-