Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.util.tree
Class MapTreeNode<T,N extends org.eclipse.jface.viewers.TreeNode>

java.lang.Object
  extended by org.eclipse.jface.viewers.TreeNode
      extended by eu.esdihumboldt.hale.ui.util.tree.AbstractMultiColumnTreeNode
          extended by eu.esdihumboldt.hale.ui.util.tree.MapTreeNode<T,N>
Type Parameters:
T - the key type
N - the node type
Direct Known Subclasses:
SortedMapTreeNode

public class MapTreeNode<T,N extends org.eclipse.jface.viewers.TreeNode>
extends AbstractMultiColumnTreeNode

Tree node that associates children with a key

Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Constructor Summary
MapTreeNode(Object... values)
          Create a new node
 
Method Summary
 void addChild(T key, N child)
          Add a child to the node
protected  Map<T,N> createMap()
          Create the map that is used to manage the children
 N getChild(T key)
          Get the child with the given key
protected  Collection<? extends org.eclipse.jface.viewers.TreeNode> getChildNodes()
          Get the child nodes
 void removeChild(T key)
          Remove the child node with the given key
 void removeChildNode(N child)
          Remove a child node
 void setChildren(org.eclipse.jface.viewers.TreeNode[] children)
           
 
Methods inherited from class eu.esdihumboldt.hale.ui.util.tree.AbstractMultiColumnTreeNode
equals, getChildren, getFirstValue, getValue, hasChildren, hashCode, setValues
 
Methods inherited from class org.eclipse.jface.viewers.TreeNode
getParent, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapTreeNode

public MapTreeNode(Object... values)
Create a new node

Parameters:
values - the node values
Method Detail

createMap

protected Map<T,N> createMap()
Create the map that is used to manage the children

Returns:
the map to manage the children

addChild

public void addChild(T key,
                     N child)
Add a child to the node

Parameters:
key - the key
child - the child node

getChild

public N getChild(T key)
Get the child with the given key

Parameters:
key - the key
Returns:
the child or null

removeChild

public void removeChild(T key)
Remove the child node with the given key

Parameters:
key - the child node

setChildren

public void setChildren(org.eclipse.jface.viewers.TreeNode[] children)
Overrides:
setChildren in class org.eclipse.jface.viewers.TreeNode
See Also:
TreeNode.setChildren(TreeNode[])

getChildNodes

protected Collection<? extends org.eclipse.jface.viewers.TreeNode> getChildNodes()
Description copied from class: AbstractMultiColumnTreeNode
Get the child nodes

Specified by:
getChildNodes in class AbstractMultiColumnTreeNode
Returns:
a collection of child nodes, it should never be changed
See Also:
AbstractMultiColumnTreeNode.getChildNodes()

removeChildNode

public void removeChildNode(N child)
Remove a child node

Parameters:
child - the child node

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d