org.glassfish.admingui.common.tree
Class JndiBrowserTreeAdaptor

java.lang.Object
  extended by com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
      extended by org.glassfish.admingui.common.tree.JndiBrowserTreeAdaptor
All Implemented Interfaces:
com.sun.jsftemplating.component.factory.tree.TreeAdaptor

public class JndiBrowserTreeAdaptor
extends com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase

The WebServiceTreeAdaptor implementation must have a public static WebServiceTreeAdaptor getInstance(FacesContext, LayoutComponent, UIComponent) method in order to get access to an instance of the WebServiceTreeAdaptor instance.

This class is used by DynamicTreeNodeFactory.

Author:
Ana Caballero

Constructor Summary
protected JndiBrowserTreeAdaptor(com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, javax.faces.component.UIComponent parent)
           This constructor saves the LayoutComponent descriptor and the UIComponent associated with this TreeAdaptor.
 
Method Summary
 java.util.List getChildTreeNodeObjects(java.lang.Object nodeObject)
           Returns child TreeNodes for the given TreeNode model Object.
 java.util.Map<java.lang.String,javax.faces.component.UIComponent> getFacets(javax.faces.component.UIComponent comp, java.lang.Object nodeObject)
           This method returns any facets that should be applied to the TreeNode (comp).
 java.util.Map<java.lang.String,java.lang.Object> getFactoryOptions(java.lang.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.
 java.util.Map getHandlersByType(javax.faces.component.UIComponent comp, java.lang.Object nodeObject)
           Advanced framework feature which provides better handling for things such as expanding TreeNodes, beforeEncode, and other events.
 java.lang.String getId(java.lang.Object nodeObject)
           This method returns the id for the given tree node model object.
static com.sun.jsftemplating.component.factory.tree.TreeAdaptor getInstance(javax.faces.context.FacesContext ctx, com.sun.jsftemplating.layout.descriptors.LayoutComponent desc, javax.faces.component.UIComponent parent)
           This method provides access to an WebServiceTreeAdaptor instance.
 boolean hasChildren(java.lang.Object node)
           
 void init()
           This method is called shortly after getInstance(FacesContext, LayoutComponent, UIComponent).
 
Methods inherited from class com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase
getFacets, getFactoryClass, getLayoutComponent, getParentUIComponent, getTreeNodeObject, setLayoutComponent, setParentUIComponent, setTreeNodeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiBrowserTreeAdaptor

protected JndiBrowserTreeAdaptor(com.sun.jsftemplating.layout.descriptors.LayoutComponent desc,
                                 javax.faces.component.UIComponent parent)

This constructor saves the LayoutComponent descriptor and the UIComponent associated with this TreeAdaptor. This constructor is used by the getInstance() method.

Method Detail

getInstance

public static com.sun.jsftemplating.component.factory.tree.TreeAdaptor getInstance(javax.faces.context.FacesContext ctx,
                                                                                   com.sun.jsftemplating.layout.descriptors.LayoutComponent desc,
                                                                                   javax.faces.component.UIComponent parent)

This method provides access to an WebServiceTreeAdaptor 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 interface com.sun.jsftemplating.component.factory.tree.TreeAdaptor
Overrides:
init in class com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase

getChildTreeNodeObjects

public java.util.List getChildTreeNodeObjects(java.lang.Object nodeObject)

Returns child TreeNodes for the given TreeNode model Object.


hasChildren

public boolean hasChildren(java.lang.Object node)

getFactoryOptions

public java.util.Map<java.lang.String,java.lang.Object> getFactoryOptions(java.lang.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:

See Tree / TreeNode component documentation for more details.


getId

public java.lang.String getId(java.lang.Object nodeObject)

This method returns the id for the given tree node model object.


getFacets

public java.util.Map<java.lang.String,javax.faces.component.UIComponent> getFacets(javax.faces.component.UIComponent comp,
                                                                                   java.lang.Object nodeObject)

This method returns any facets that should be applied to the TreeNode (comp). Useful facets for the sun TreeNode component are: "content" and "image".

Facets that already exist on comp, or facets that are directly added to comp do not need to be returned from this method.

This implementation directly adds a "content" facet and returns null from this method.

Parameters:
comp - The tree node UIComponent.
nodeObject - The (model) object representing the tree node.

getHandlersByType

public java.util.Map getHandlersByType(javax.faces.component.UIComponent comp,
                                       java.lang.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 of List of Handler objects. Each List in the Map should be registered under a key that cooresponds to to the "event" in which the Handlers should be invoked.

Specified by:
getHandlersByType in interface com.sun.jsftemplating.component.factory.tree.TreeAdaptor
Overrides:
getHandlersByType in class com.sun.jsftemplating.component.factory.tree.TreeAdaptorBase


Copyright © 2012 GlassFish Community. All Rights Reserved.