This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f994e1  [NETBEANS-2002] Run Gradle Tasks from Navigator as a default 
Action.
1f994e1 is described below

commit 1f994e104be5b8eb7184ba6f98ac997af3fd5d3d
Author: Laszlo Kishalmi <laszlo.kisha...@gmail.com>
AuthorDate: Sat Feb 9 17:55:25 2019 -0800

    [NETBEANS-2002] Run Gradle Tasks from Navigator as a default Action.
---
 .../gradle/execute/navigator/TasksPanel.java       | 37 +++++++++-------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git 
a/groovy/gradle/src/org/netbeans/modules/gradle/execute/navigator/TasksPanel.java
 
b/groovy/gradle/src/org/netbeans/modules/gradle/execute/navigator/TasksPanel.java
index 46b92f1..c064c20 100644
--- 
a/groovy/gradle/src/org/netbeans/modules/gradle/execute/navigator/TasksPanel.java
+++ 
b/groovy/gradle/src/org/netbeans/modules/gradle/execute/navigator/TasksPanel.java
@@ -20,7 +20,6 @@
 package org.netbeans.modules.gradle.execute.navigator;
 
 import org.netbeans.modules.gradle.ActionProviderImpl;
-import org.netbeans.modules.gradle.GradleProject;
 import org.netbeans.modules.gradle.api.GradleTask;
 import org.netbeans.modules.gradle.api.NbGradleProject;
 import org.netbeans.modules.gradle.api.execute.ActionMapping;
@@ -68,14 +67,10 @@ public class TasksPanel extends javax.swing.JPanel 
implements ExplorerManager.Pr
     private NbGradleProject current;
     private Project currentP;
 
-    private final PropertyChangeListener pchadapter = new 
PropertyChangeListener() {
-
-        @Override
-        public void propertyChange(PropertyChangeEvent evt) {
-            if 
(NbGradleProject.PROP_PROJECT_INFO.equals(evt.getPropertyName())) {
-                showWaitNode();
-                RequestProcessor.getDefault().post(TasksPanel.this);
-            }
+    private final PropertyChangeListener pchadapter = (PropertyChangeEvent 
evt) -> {
+        if (NbGradleProject.PROP_PROJECT_INFO.equals(evt.getPropertyName())) {
+            showWaitNode();
+            RequestProcessor.getDefault().post(TasksPanel.this);
         }
     };
 
@@ -163,24 +158,18 @@ public class TasksPanel extends javax.swing.JPanel 
implements ExplorerManager.Pr
                 }
                 ch.add(new Node[]{new 
TaskGroupNode(GradleBaseProject.PRIVATE_TASK_GROUP, prj)});
 
-                SwingUtilities.invokeLater(new Runnable() {
-                    @Override
-                    public void run() {
-                        treeView.setRootVisible(false);
-                        manager.setRootContext(new AbstractNode(ch));
-                        treeView.expandAll();
-                    }
+                SwingUtilities.invokeLater(() -> {
+                    treeView.setRootVisible(false);
+                    manager.setRootContext(new AbstractNode(ch));
+                    treeView.expandAll();
                 });
                 return;
             }
 
         }
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                treeView.setRootVisible(false);
-                manager.setRootContext(createEmptyNode());
-            }
+        SwingUtilities.invokeLater(() -> {
+            treeView.setRootVisible(false);
+            manager.setRootContext(createEmptyNode());
         });
     }
 
@@ -299,6 +288,10 @@ public class TasksPanel extends javax.swing.JPanel 
implements ExplorerManager.Pr
             return task;
         }
 
+        @Override
+        public Action getPreferredAction() {
+            return getActions(false)[0];
+        }
     }
 
     private class TaskGroupChildren extends ChildFactory<GradleTask> {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to