use of eu.esdihumboldt.hale.ui.util.tree.DefaultTreeNode in project hale by halestudio.
the class TaskTreeView method addTask.
/**
* Add a resolved task
*
* @param task the task to add
*/
@SuppressWarnings("unchecked")
private <C> void addTask(ResolvedTask<C> task) {
// add task to model
MapTreeNode<ResolvedTask<C>, TreeNode> parent = (MapTreeNode<ResolvedTask<C>, TreeNode>) getParentNode(task, true);
if (parent != null) {
DefaultTreeNode node = new DefaultTreeNode(task);
parent.addChild(task, node);
taskNodes.put(task.getTask(), node);
// update viewer
tree.refresh(parent, true);
// update icons
TreeNode updateNode = parent.getParent();
while (updateNode != null) {
tree.update(updateNode, null);
updateNode = updateNode.getParent();
}
}
}
Aggregations