Class DirectoryContentProvider
- java.lang.Object
-
- org.nuxeo.ecm.webengine.ui.tree.directory.DirectoryContentProvider
-
- All Implemented Interfaces:
Serializable
,ContentProvider
public class DirectoryContentProvider extends Object implements ContentProvider
- Author:
- Bogdan Stefanescu
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectoryContentProvider(Session session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createQuery(DocumentModel parent, Map<String,Serializable> query)
Object[]
getChildren(Object obj)
Gets the children for the given object.Object[]
getElements(Object input)
Gets the top level items.String[]
getFacets(Object object)
Gets the object facets.String
getLabel(Object obj)
Gets the label to be used when displaying the given object.String
getName(Object obj)
Gets the name of the object.Session
getSession()
boolean
isContainer(Object obj)
Whether the given object may have children (e.g it's a container).
-
-
-
Field Detail
-
session
protected final Session session
-
-
Constructor Detail
-
DirectoryContentProvider
public DirectoryContentProvider(Session session)
-
-
Method Detail
-
getSession
public Session getSession()
-
createQuery
protected void createQuery(DocumentModel parent, Map<String,Serializable> query)
-
getElements
public Object[] getElements(Object input)
Description copied from interface:ContentProvider
Gets the top level items.The items will be shown on the top level of the tree. These items are computed from the tree input that will be considered the tree root. The tree root is not visible.
- Specified by:
getElements
in interfaceContentProvider
- Parameters:
input
- the tree view input- Returns:
- the top level items
-
getChildren
public Object[] getChildren(Object obj)
Description copied from interface:ContentProvider
Gets the children for the given object.This method is used to populate the nested branches of the tree.
- Specified by:
getChildren
in interfaceContentProvider
- Parameters:
obj
- the object- Returns:
- the children or null if no children are supported
-
isContainer
public boolean isContainer(Object obj)
Description copied from interface:ContentProvider
Whether the given object may have children (e.g it's a container).- Specified by:
isContainer
in interfaceContentProvider
- Parameters:
obj
- the object to test- Returns:
- true if it may have children, false otherwise
-
getName
public String getName(Object obj)
Description copied from interface:ContentProvider
Gets the name of the object.The name must be an unique identifier relative to the parent item. It will be used as node names in the tree so that they will construct the item path.
- Specified by:
getName
in interfaceContentProvider
- Parameters:
obj
- the object- Returns:
- the name
-
getLabel
public String getLabel(Object obj)
Description copied from interface:ContentProvider
Gets the label to be used when displaying the given object.- Specified by:
getLabel
in interfaceContentProvider
- Parameters:
obj
- the object- Returns:
- the label
-
getFacets
public String[] getFacets(Object object)
Description copied from interface:ContentProvider
Gets the object facets.Facets are arbitrary strings that should describe object capabilities and can be used to decorate later the item.
In a web environment they may be translated to CSS classes.
- Specified by:
getFacets
in interfaceContentProvider
- Returns:
- item facets
-
-