Class ListTreeAdaptor
- All Implemented Interfaces:
com.sun.jsftemplating.component.factory.tree.TreeAdaptor
The ListTreeAdaptor implementation must have a
public static ListTreeAdaptor getInstance(FacesContext,
LayoutComponent, UIComponent) method in order to get access to
an instance of the ListTreeAdaptor instance.
This class is used by DynamicTreeNodeFactory.
Valid options for this implementation:
- children (required) -- The children to display.
- text -- The root TreeNode text.
- url -- The root TreeNode URL.
- imageURL -- The root TreeNode Image URL.
- target -- The target of the link for the root TreeNode.
- action -- The JSF EL expression to an action associated with the root TreeNode.
- actionListener -- The turner JSF actionListener for the root TreeNode.
- expanded -- Whether the root TreeNode should be expanded by default (true/false)
- rendered -- The JSF rendered flag for the root TreeNode.
- childNameKey -- When the child is represented by a Map, the "key" used to extract the name of the TreeNode from the Map.
- childURL -- The child TreeNode URL.
- childImageURL -- The child TreeNode Image URL.
- childCommand -- The child TreeNode JSFTemplating command.
- childTarget -- The child TreeNode link target.
- childAction --The child TreeNode JSF action.
- targetConfigName -- The child TreeNode target config name.
- childActionListener -- The JSF ActionListener for the child TreeNode hyperlink.
- childExpanded -- Boolean flag indicating whether to render the child TreeNodes expanded.
- Author:
- Ken Paulsen (ken.paulsen@oracle.com)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedListTreeAdaptor(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 childTreeNodes for the givenTreeNodemodel Object.This method returns any facets that should be applied to theTreeNode (comp).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 anListTreeAdaptorinstance.voidinit()This method is called shortly aftergetInstance(FacesContext, LayoutComponent, UIComponent).Methods inherited from class com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
getFacets, getFactoryClass, getLayoutComponent, getParentUIComponent, getTreeNodeObject, setLayoutComponent, setParentUIComponent, setTreeNodeObject
-
Constructor Details
-
ListTreeAdaptor
protected ListTreeAdaptor(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
ListTreeAdaptorinstance. 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
TreeNodes for the givenTreeNodemodel Object. -
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
-