Search in sources :

Example 6 with DefaultTreeNode

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();
        }
    }
}
Also used : ResolvedTask(eu.esdihumboldt.hale.common.tasks.ResolvedTask) DefaultTreeNode(eu.esdihumboldt.hale.ui.util.tree.DefaultTreeNode) MapTreeNode(eu.esdihumboldt.hale.ui.util.tree.MapTreeNode) TreeNode(org.eclipse.jface.viewers.TreeNode) SortedMapTreeNode(eu.esdihumboldt.hale.ui.util.tree.SortedMapTreeNode) DefaultTreeNode(eu.esdihumboldt.hale.ui.util.tree.DefaultTreeNode) MapTreeNode(eu.esdihumboldt.hale.ui.util.tree.MapTreeNode) SortedMapTreeNode(eu.esdihumboldt.hale.ui.util.tree.SortedMapTreeNode)

Aggregations

DefaultTreeNode (eu.esdihumboldt.hale.ui.util.tree.DefaultTreeNode)6 ResolvedTask (eu.esdihumboldt.hale.common.tasks.ResolvedTask)5 MapTreeNode (eu.esdihumboldt.hale.ui.util.tree.MapTreeNode)5 TreeNode (org.eclipse.jface.viewers.TreeNode)5 SortedMapTreeNode (eu.esdihumboldt.hale.ui.util.tree.SortedMapTreeNode)3 Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 TaskSeverity (eu.esdihumboldt.hale.common.tasks.TaskType.TaskSeverity)1