Search in sources :

Example 11 with ResolvedTask

use of eu.esdihumboldt.hale.common.tasks.ResolvedTask 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)11 DefaultTreeNode (eu.esdihumboldt.hale.ui.util.tree.DefaultTreeNode)8 Cell (eu.esdihumboldt.hale.common.align.model.Cell)7 MapTreeNode (eu.esdihumboldt.hale.ui.util.tree.MapTreeNode)7 TreeNode (org.eclipse.jface.viewers.TreeNode)7 TaskService (eu.esdihumboldt.hale.common.tasks.TaskService)5 SortedMapTreeNode (eu.esdihumboldt.hale.ui.util.tree.SortedMapTreeNode)5 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 Task (eu.esdihumboldt.hale.common.tasks.Task)3 ISelection (org.eclipse.jface.viewers.ISelection)3 Composite (org.eclipse.swt.widgets.Composite)3 ISelectionListener (org.eclipse.ui.ISelectionListener)3 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)3 DefaultCell (eu.esdihumboldt.hale.common.align.model.impl.DefaultCell)2 TaskServiceListener (eu.esdihumboldt.hale.common.tasks.TaskServiceListener)2 HaleUI (eu.esdihumboldt.hale.ui.HaleUI)2 SchemaSelection (eu.esdihumboldt.hale.ui.selection.SchemaSelection)2 AlignmentService (eu.esdihumboldt.hale.ui.service.align.AlignmentService)2 AlignmentServiceAdapter (eu.esdihumboldt.hale.ui.service.align.AlignmentServiceAdapter)2 ArrayList (java.util.ArrayList)2