Package com.hybris.backoffice.navigation
Class NavigationNodeDecorator
- java.lang.Object
-
- com.hybris.backoffice.navigation.NavigationNodeDecorator
-
- All Implemented Interfaces:
ActionDefinition,NavigationNode,java.io.Serializable
public class NavigationNodeDecorator extends java.lang.Object implements NavigationNode
Decorate NavigationNode with functionality of evaluating text to display- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NavigationNodeDecorator(NavigationNode target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(NavigationNode child)Adds the given node as a child of this node.voidcalculateUiLabel(ExplorerTreeController widgetController)booleanequals(java.lang.Object obj)java.util.List<NavigationNode>getChildren()Returns all children nodes.CockpitContextgetContext()Returns node contextjava.lang.ObjectgetData()Returns data associated with the node.java.lang.StringgetDescription()Returns the description of the node.java.lang.StringgetDescriptionLocKey()Returns the localization key for the description of the node.java.lang.StringgetIconUri()Returns the icon URI of the node.java.lang.StringgetIconUriLocKey()Returns the localization key for the icon URI of the node.java.lang.StringgetId()Returns the ID of the node.intgetLevel()Returns the level of this node.java.lang.StringgetName()Returns the name of the node.java.lang.StringgetNameLocKey()Returns the localization key for the name of the node.NavigationNodegetParent()Returns the parent node of this node.NavigationNodegetTarget()java.lang.StringgetUiLabel(ExplorerTreeController controller)inthashCode()booleanisDirectory()Returnstrueif this node can have children.booleanisExpandedByDefault()Returns true if this node should be expanded by default when the tree is created.voidsetChildren(java.util.List<NavigationNode> children)Sets the given list to be child nodes of this node.voidsetContext(CockpitContext context)Sets node contextvoidsetParent(NavigationNode parent)Sets the parent of this node to the given node.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.backoffice.actionbar.ActionDefinition
getGroup
-
-
-
-
Constructor Detail
-
NavigationNodeDecorator
public NavigationNodeDecorator(NavigationNode target)
-
-
Method Detail
-
getTarget
public NavigationNode getTarget()
-
calculateUiLabel
public void calculateUiLabel(ExplorerTreeController widgetController)
-
getUiLabel
public java.lang.String getUiLabel(ExplorerTreeController controller)
-
getId
public java.lang.String getId()
Description copied from interface:ActionDefinitionReturns the ID of the node. Should be unique within the tree structure.- Specified by:
getIdin interfaceActionDefinition- Returns:
- ID of the node
-
getData
public java.lang.Object getData()
Description copied from interface:NavigationNodeReturns data associated with the node. If no data are associated with the node it returnsnull.- Specified by:
getDatain interfaceNavigationNode- Returns:
- data associated with the node or
nullif no data are associated with the node
-
getNameLocKey
public java.lang.String getNameLocKey()
Description copied from interface:ActionDefinitionReturns the localization key for the name of the node. This will be used to get the localized name of the node in the current Locale. If this isnullthenActionDefinition.getName()is used as the node name.- Specified by:
getNameLocKeyin interfaceActionDefinition- Returns:
- localization key for the name of the node or
nullifActionDefinition.getName()is should be used as the node name - See Also:
ActionDefinition.getName()
-
getName
public java.lang.String getName()
Description copied from interface:ActionDefinitionReturns the name of the node. This is only used as a node name if the localization key for the node name is not set (seeActionDefinition.getNameLocKey()).- Specified by:
getNamein interfaceActionDefinition- Returns:
- the name of the node
- See Also:
ActionDefinition.getNameLocKey()
-
getDescriptionLocKey
public java.lang.String getDescriptionLocKey()
Description copied from interface:ActionDefinitionReturns the localization key for the description of the node. This will be used to get the localized description of the node in the current Locale. If this isnullthenActionDefinition.getDescription()is used as the node description.- Specified by:
getDescriptionLocKeyin interfaceActionDefinition- Returns:
- localization key for the description of the node or
nullifActionDefinition.getDescription()is should be used as the node description - See Also:
ActionDefinition.getDescription()
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ActionDefinitionReturns the description of the node. This is only used as a node description if the localization key for the node description is not set (seeActionDefinition.getDescriptionLocKey()).- Specified by:
getDescriptionin interfaceActionDefinition- Returns:
- the description of the node
- See Also:
ActionDefinition.getDescriptionLocKey()
-
getIconUriLocKey
public java.lang.String getIconUriLocKey()
Description copied from interface:ActionDefinitionReturns the localization key for the icon URI of the node. This will be used to get the localized icon URI of the node in the current Locale. If this isnullthenActionDefinition.getIconUri()is used as the node description.- Specified by:
getIconUriLocKeyin interfaceActionDefinition- Returns:
- localization key for the icon URI of the node or
nullifActionDefinition.getIconUri()is should be used as the node icon URI - See Also:
ActionDefinition.getIconUri()
-
getIconUri
public java.lang.String getIconUri()
Description copied from interface:ActionDefinitionReturns the icon URI of the node. This is only used as a node icon URI if the localization key for the node icon URI is not set (seeActionDefinition.getIconUriLocKey()).- Specified by:
getIconUriin interfaceActionDefinition- Returns:
- the icon URI of the node
- See Also:
ActionDefinition.getIconUriLocKey()
-
getParent
public NavigationNode getParent()
Description copied from interface:NavigationNodeReturns the parent node of this node.- Specified by:
getParentin interfaceNavigationNode- Returns:
- parent node of this node or
nullif this is a root node
-
getChildren
public java.util.List<NavigationNode> getChildren()
Description copied from interface:NavigationNodeReturns all children nodes.- Specified by:
getChildrenin interfaceNavigationNode- Returns:
- all children nodes
-
setChildren
public void setChildren(java.util.List<NavigationNode> children)
Description copied from interface:NavigationNodeSets the given list to be child nodes of this node.- Specified by:
setChildrenin interfaceNavigationNode- Parameters:
children- list of nodes to become children of this node
-
addChild
public void addChild(NavigationNode child)
Description copied from interface:NavigationNodeAdds the given node as a child of this node.- Specified by:
addChildin interfaceNavigationNode- Parameters:
child- a node to become a child of this node
-
setParent
public void setParent(NavigationNode parent)
Description copied from interface:NavigationNodeSets the parent of this node to the given node.- Specified by:
setParentin interfaceNavigationNode- Parameters:
parent- a node to become a parent of this node
-
getLevel
public int getLevel()
Description copied from interface:NavigationNodeReturns the level of this node. A root node has level = 0.- Specified by:
getLevelin interfaceNavigationNode- Returns:
- level of this node
-
isDirectory
public boolean isDirectory()
Description copied from interface:NavigationNodeReturnstrueif this node can have children.- Specified by:
isDirectoryin interfaceNavigationNode- Returns:
trueif this node can have children andfalseotherwise
-
isExpandedByDefault
public boolean isExpandedByDefault()
Description copied from interface:NavigationNodeReturns true if this node should be expanded by default when the tree is created.- Specified by:
isExpandedByDefaultin interfaceNavigationNode- Returns:
- true if this node should be expanded by default; false otherwise
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getContext
public CockpitContext getContext()
Description copied from interface:NavigationNodeReturns node context- Specified by:
getContextin interfaceNavigationNode- Returns:
- new DefaultCockpitContext by default
-
setContext
public void setContext(CockpitContext context)
Description copied from interface:NavigationNodeSets node context- Specified by:
setContextin interfaceNavigationNode
-
-