Package org.opencms.ui.apps
Class CmsAppCategoryNode
- java.lang.Object
-
- org.opencms.ui.apps.CmsAppCategoryNode
-
- All Implemented Interfaces:
I_CmsHasOrder
public class CmsAppCategoryNode extends java.lang.Object implements I_CmsHasOrder
Tree node representing an app category.Contains a list of child nodes and a list of apps, which are the leaves of the tree. Note that the list of children is not initialized after construction, it has to be filled manually.
-
-
Constructor Summary
Constructors Constructor Description CmsAppCategoryNode(I_CmsAppCategory appCategory)
Creates a new category node for the given category.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAppConfiguration(I_CmsWorkplaceAppConfiguration appConfig)
Adds an app configuration.void
addChild(CmsAppCategoryNode node)
Adds a child node.java.util.List<I_CmsWorkplaceAppConfiguration>
getAppConfigurations()
Gets the app configurations for this category.I_CmsAppCategory
getCategory()
Gets the app category data for this node.java.util.List<CmsAppCategoryNode>
getChildren()
Gets the child nodes of this node.int
getOrder()
Gets an integer used to sort items.void
removeApplessSubtrees()
Recursively removes subtrees containing no app configurations.void
sort()
Sorts the child nodes *and* the apps of this node by their order.void
sortRecursively()
Recursively calls sort on all descendants of this node.
-
-
-
Constructor Detail
-
CmsAppCategoryNode
public CmsAppCategoryNode(I_CmsAppCategory appCategory)
Creates a new category node for the given category.- Parameters:
appCategory
- the category data
-
-
Method Detail
-
addAppConfiguration
public void addAppConfiguration(I_CmsWorkplaceAppConfiguration appConfig)
Adds an app configuration.- Parameters:
appConfig
- the app configuration to add
-
addChild
public void addChild(CmsAppCategoryNode node)
Adds a child node.- Parameters:
node
- the child node
-
getAppConfigurations
public java.util.List<I_CmsWorkplaceAppConfiguration> getAppConfigurations()
Gets the app configurations for this category.- Returns:
- the app configurations
-
getCategory
public I_CmsAppCategory getCategory()
Gets the app category data for this node.- Returns:
- the app category data
-
getChildren
public java.util.List<CmsAppCategoryNode> getChildren()
Gets the child nodes of this node.- Returns:
- the child nodes
-
getOrder
public int getOrder()
Description copied from interface:I_CmsHasOrder
Gets an integer used to sort items.- Specified by:
getOrder
in interfaceI_CmsHasOrder
- Returns:
- the integer used as a sort key
- See Also:
I_CmsHasOrder.getOrder()
-
removeApplessSubtrees
public void removeApplessSubtrees()
Recursively removes subtrees containing no app configurations.
-
sort
public void sort()
Sorts the child nodes *and* the apps of this node by their order.
-
sortRecursively
public void sortRecursively()
Recursively calls sort on all descendants of this node.
-
-