use of org.gradle.foundation.TaskView in project gradle by gradle.
the class TaskTreeTab method createTreePanel.
private Component createTreePanel() {
treeComponent = new TaskTreeComponent(gradlePluginLord, new TaskTreeComponent.Interaction() {
public void rightClick(JTree tree, int x, int y) {
enableThingsAppropriately();
popupMenu.show(tree, x, y);
}
public void taskInvoked(TaskView task, boolean isCtrlKeyDown) {
if (isCtrlKeyDown) {
gradlePluginLord.addExecutionRequestToQueue(task, false, "-a");
} else {
gradlePluginLord.addExecutionRequestToQueue(task, false);
}
}
public void projectInvoked(ProjectView project) {
executeDefaultTasksInProject(project);
}
});
treeComponent.getTree().addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
enableThingsAppropriately();
}
});
defaultTreeBackground = treeComponent.getTree().getBackground();
treeScrollPane = new JScrollPane();
//change the color to better indicate that
treeComponent.getTree().setBackground(workingBackgroundColor);
showTextInViewport("Has not built projects/tasks yet.");
return treeScrollPane;
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class TaskTreeTab method getSelectedTaskNames.
/**
* This puts all the selected task names in a space-delimited String
*
* @return a string of all the tasks
*/
private String getSelectedTaskNames() {
List<TaskView> tasks = treeComponent.getSelectedTasks();
if (tasks.isEmpty()) {
return null;
}
StringBuilder taskString = new StringBuilder();
Iterator<TaskView> iterator = tasks.iterator();
while (iterator.hasNext()) {
TaskView taskView = iterator.next();
taskString.append(taskView.getFullTaskName());
if (iterator.hasNext()) {
taskString.append(' ');
}
}
return taskString.toString();
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class TaskWrapper method convertTasks.
/**
* Converts the list of TaskView objects to TaskVersion1 objects. It just wraps them.
*
* @param taskViewList the source tasks
* @return the tasks wrapped in TaskWrappers.
*/
public static List<TaskVersion1> convertTasks(List<TaskView> taskViewList) {
List<TaskVersion1> returnTasks = new ArrayList<TaskVersion1>();
Iterator<TaskView> taskViewIterator = taskViewList.iterator();
while (taskViewIterator.hasNext()) {
TaskView taskView = taskViewIterator.next();
returnTasks.add(new TaskWrapper(taskView));
}
return returnTasks;
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class FavoritesEditor method addFavorites.
/**
* Call this to add the specified tasks as favorite tasks
*
* @param tasks the task to make a favorite.
*/
public void addFavorites(List<TaskView> tasks, boolean alwaysShowOutput) {
boolean addedFavorite = false;
Iterator<TaskView> iterator = tasks.iterator();
while (iterator.hasNext()) {
TaskView task = iterator.next();
String fullTaskName = task.getFullTaskName();
if (this.addFavorite(fullTaskName, alwaysShowOutput) != null) {
addedFavorite = true;
}
}
if (addedFavorite) {
//don't notify anyone unless we actually did something.
favoriteTasksObserverLord.notifyObservers(new ObserverLord.ObserverNotification<FavoritesEditor.FavoriteTasksObserver>() {
public void notify(FavoritesEditor.FavoriteTasksObserver observer) {
observer.favoritesChanged();
}
});
}
}
use of org.gradle.foundation.TaskView in project gradle by gradle.
the class BasicFilterEditor method showTasks.
public void showTasks(List<TaskView> filteredTasks) {
Iterator<TaskView> iterator = filteredTasks.iterator();
while (iterator.hasNext()) {
TaskView taskView = iterator.next();
filteredOutTaskNames.remove(taskView.getName());
}
notifyChanges();
}
Aggregations