Search in sources :

Example 11 with TaskView

use of org.gradle.foundation.TaskView in project gradle by gradle.

the class TaskTreePopulationVisitor method visitTasks.

/*
       Add the list of tasks to the parent tree node.
    */
private static <P, T> List<T> visitTasks(Visitor<P, T> visitor, ProjectAndTaskFilter filter, ProjectView project, int startingIndex, P userProjectObject, Comparator<TaskView> taskSorter) {
    List<T> taskObjects = new ArrayList<T>();
    //make a copy because we're going to sort them
    List<TaskView> tasks = CollectionUtils.sort(project.getTasks(), taskSorter);
    Iterator<TaskView> iterator = tasks.iterator();
    int index = startingIndex;
    while (iterator.hasNext()) {
        TaskView task = iterator.next();
        if (filter.doesAllowTask(task)) {
            T taskObject = visitor.visitTask(task, index, project, userProjectObject);
            taskObjects.add(taskObject);
        }
        index++;
    }
    return taskObjects;
}
Also used : TaskView(org.gradle.foundation.TaskView)

Aggregations

TaskView (org.gradle.foundation.TaskView)11 ArrayList (java.util.ArrayList)2 SwingAddMultipleFavoritesInteraction (org.gradle.gradleplugin.userinterface.swing.generic.SwingAddMultipleFavoritesInteraction)2 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)1 TreeSelectionListener (javax.swing.event.TreeSelectionListener)1 ProjectView (org.gradle.foundation.ProjectView)1 ObserverLord (org.gradle.foundation.common.ObserverLord)1 AlternateUIInteraction (org.gradle.gradleplugin.userinterface.AlternateUIInteraction)1 TaskTreeComponent (org.gradle.gradleplugin.userinterface.swing.generic.TaskTreeComponent)1 TaskVersion1 (org.gradle.openapi.external.foundation.TaskVersion1)1