use of org.gradle.foundation.TaskView in project gradle by gradle.
the class TaskTreeTab method addSelectedToFavorites.
/**
* Adds whatever is selected to the favorites.
*/
private void addSelectedToFavorites() {
List<TaskView> tasks = treeComponent.getSelectedTasks();
gradlePluginLord.getFavoritesEditor().addMutlipleFavorites(tasks, false, new SwingAddMultipleFavoritesInteraction(SwingUtilities.getWindowAncestor(mainPanel)));
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class TaskTreeTab method executeDefaultTasksInProject.
/**
* This executes all default tasks in the specified project.
*
* @param project the project to execute.
*/
private void executeDefaultTasksInProject(ProjectView project) {
Iterator<TaskView> iterator = project.getDefaultTasks().iterator();
while (iterator.hasNext()) {
TaskView task = iterator.next();
gradlePluginLord.addExecutionRequestToQueue(task, false);
}
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class AllProjectsAndTasksVisitor 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, P userProjectObject) {
List<T> taskObjects = new ArrayList<T>();
Iterator<TaskView> iterator = project.getTasks().iterator();
while (iterator.hasNext()) {
TaskView task = iterator.next();
if (filter.doesAllowTask(task)) {
T taskObject = visitor.visitTask(task, project, userProjectObject);
taskObjects.add(taskObject);
}
}
return taskObjects;
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class FavoritesEditor method addMutlipleFavorites.
/**
* Call this to add tasks as favorites. If you pass in multiple tasks, we'll prompt the user whether or not the tasks should be added as one favorite with multiple tasks or separate tasks.
*
* @param tasks the tasks to add. Their order in the list becomes the order in the single task if the user chooses this.
* @param interaction how we interact with the user or other UI.
*/
public void addMutlipleFavorites(List<TaskView> tasks, boolean alwaysShowOutput, AddMultipleFavoritesInteraction interaction) {
if (tasks.isEmpty()) {
return;
}
if (tasks.size() == 1) {
//only 1 task. just add it
addFavorite(tasks.get(0), alwaysShowOutput);
return;
}
//multiple tasks. Ask the user what to do
String singleCommandLine = CommandLineAssistant.combineTasks(tasks);
//prompt the user what to do
AddMultipleResult addMultipleResult = interaction.promptUserToCombineTasks(tasks, singleCommandLine);
switch(addMultipleResult) {
case Cancel:
return;
case AddSeparately:
Iterator<TaskView> iterator = tasks.iterator();
while (iterator.hasNext()) {
TaskView task = iterator.next();
addFavorite(task, alwaysShowOutput);
}
break;
case AddAsSingleCommand:
addFavorite(singleCommandLine, alwaysShowOutput);
break;
}
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class BasicFilterEditor method hideTasks.
public void hideTasks(List<TaskView> filteredTasks) {
Iterator<TaskView> iterator = filteredTasks.iterator();
while (iterator.hasNext()) {
TaskView taskView = iterator.next();
if (!filteredOutTaskNames.contains(taskView.getName())) {
filteredOutTaskNames.add(taskView.getName());
}
}
notifyChanges();
}
Aggregations