Search in sources :

Example 6 with MapTreeNode

use of eu.esdihumboldt.hale.ui.util.tree.MapTreeNode 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

ResolvedTask (eu.esdihumboldt.hale.common.tasks.ResolvedTask)6 DefaultTreeNode (eu.esdihumboldt.hale.ui.util.tree.DefaultTreeNode)6 MapTreeNode (eu.esdihumboldt.hale.ui.util.tree.MapTreeNode)6 TreeNode (org.eclipse.jface.viewers.TreeNode)6 SortedMapTreeNode (eu.esdihumboldt.hale.ui.util.tree.SortedMapTreeNode)4 Cell (eu.esdihumboldt.hale.common.align.model.Cell)3 Task (eu.esdihumboldt.hale.common.tasks.Task)1 TaskService (eu.esdihumboldt.hale.common.tasks.TaskService)1 TaskSeverity (eu.esdihumboldt.hale.common.tasks.TaskType.TaskSeverity)1 ArrayList (java.util.ArrayList)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1