Class SimpleNode
- java.lang.Object
-
- com.hybris.backoffice.actionbar.DefaultActionDefinition
-
- com.hybris.backoffice.navigation.impl.SimpleNode
-
- All Implemented Interfaces:
ActionDefinition,NavigationNode,ActionAwareNode,java.io.Serializable
- Direct Known Subclasses:
DynamicNode,TypeNode
public class SimpleNode extends DefaultActionDefinition implements NavigationNode, ActionAwareNode
Represents a navigation node with name, description and icon. It can hold a data object as well.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleNode(java.lang.String id)SimpleNode(java.lang.String id, java.lang.Object data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(NavigationNode child)Adds the given node as a child of this node.static SimpleNodecreate(ActionDefinition action)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.intgetLevel()Returns the level of this node.NavigationNodegetParent()Returns the parent node of this node.inthashCode()booleanisActionAware()Defines if node is action awarebooleanisDirectory()Returnstrueif this node can have children.booleanisExpandedByDefault()Returns true if this node should be expanded by default when the tree is created.voidsetActionAware(boolean actionAware)voidsetChildren(java.util.List<NavigationNode> children)Sets the given list to be child nodes of this node.voidsetContext(CockpitContext context)Sets node contextvoidsetData(java.lang.Object data)voidsetDirectory(boolean directory)voidsetExpandedByDefault(boolean expandedByDefault)voidsetLevel(int level)voidsetParent(NavigationNode parent)Sets the parent of this node to the given node.-
Methods inherited from class com.hybris.backoffice.actionbar.DefaultActionDefinition
getDescription, getDescriptionLocKey, getGroup, getIconUri, getIconUriLocKey, getId, getName, getNameLocKey, setDescription, setDescriptionLocKey, setGroup, setIconUri, setIconUriLocKey, setName, setNameLocKey, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.hybris.backoffice.actionbar.ActionDefinition
getDescription, getDescriptionLocKey, getGroup, getIconUri, getIconUriLocKey, getId, getName, getNameLocKey
-
-
-
-
Method Detail
-
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
-
setData
public void setData(java.lang.Object data)
-
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
-
setLevel
public void setLevel(int level)
-
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
-
setDirectory
public void setDirectory(boolean directory)
-
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
-
setExpandedByDefault
public void setExpandedByDefault(boolean expandedByDefault)
-
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
-
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
-
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
-
setActionAware
public void setActionAware(boolean actionAware)
-
isActionAware
public boolean isActionAware()
Description copied from interface:ActionAwareNodeDefines if node is action aware- Specified by:
isActionAwarein interfaceActionAwareNode- Returns:
- whether is aware or not
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classDefaultActionDefinition
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDefaultActionDefinition
-
create
public static SimpleNode create(ActionDefinition action)
-
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
-
-