Search in sources :

Example 1 with TaskTreeComponent

use of org.gradle.gradleplugin.userinterface.swing.generic.TaskTreeComponent 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;
}
Also used : TaskView(org.gradle.foundation.TaskView) AlternateUIInteraction(org.gradle.gradleplugin.userinterface.AlternateUIInteraction) SwingAddMultipleFavoritesInteraction(org.gradle.gradleplugin.userinterface.swing.generic.SwingAddMultipleFavoritesInteraction) TreeSelectionListener(javax.swing.event.TreeSelectionListener) ProjectView(org.gradle.foundation.ProjectView) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent) TaskTreeComponent(org.gradle.gradleplugin.userinterface.swing.generic.TaskTreeComponent)

Aggregations

TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)1 TreeSelectionListener (javax.swing.event.TreeSelectionListener)1 ProjectView (org.gradle.foundation.ProjectView)1 TaskView (org.gradle.foundation.TaskView)1 AlternateUIInteraction (org.gradle.gradleplugin.userinterface.AlternateUIInteraction)1 SwingAddMultipleFavoritesInteraction (org.gradle.gradleplugin.userinterface.swing.generic.SwingAddMultipleFavoritesInteraction)1 TaskTreeComponent (org.gradle.gradleplugin.userinterface.swing.generic.TaskTreeComponent)1