sdedic commented on a change in pull request #3135:
URL: https://github.com/apache/netbeans/pull/3135#discussion_r697812774



##########
File path: 
extide/gradle/src/org/netbeans/modules/gradle/actions/DefaultActionMapping.java
##########
@@ -146,6 +146,12 @@ public boolean equals(Object obj) {
         return Objects.equals(this.withPlugins, other.withPlugins);
     }
 
+    @Override
+    public String toString() {
+        return name + " [" + args + ']';
+    }
+
+    

Review comment:
       Great for debugging !

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/nodes/TaskNode.java
##########
@@ -45,6 +46,8 @@
     @StaticResource
     private static final String TASK_ICON = 
"org/netbeans/modules/gradle/resources/gradle-task.gif";
 
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       Possibly use `RunUtils.EXECUTE_TASK_ACTION` API constant ?

##########
File path: 
extide/gradle/src/org/netbeans/modules/gradle/api/execute/RunUtils.java
##########
@@ -90,6 +90,9 @@
     public static final String PROP_INCLUDE_OPEN_PROJECTS = 
"include.open.projects"; //NOI18N
     public static final String PROP_DEFAULT_CLI = "gradle.cli"; //NOI18N
 
+    /** Action to execute specific Gradle Tasks from the IDE (Eg. from 
Navigator). */
+    public static final String EXECUTE_TASK_ACTION = "execute.task"; //NOI18N

Review comment:
       API change -- `@since` and mention in `apichanges.xml`.

##########
File path: extide/gradle/src/org/netbeans/modules/gradle/ActionProviderImpl.java
##########
@@ -500,14 +503,12 @@ Action forProject(Project p, FileObject fo) {
     private final class CustomPopupActions extends AbstractAction implements 
Presenter.Popup {
 
         private final boolean onFile;
-        private final boolean onGradle;
         private final Lookup lookup;
 
         @SuppressWarnings("OverridableMethodCallInConstructor")
         private CustomPopupActions(boolean onFile, boolean onGradleFile, 
FileObject fo) {

Review comment:
       is `onGradleFile` parameter used ?

##########
File path: 
extide/gradle/src/org/netbeans/modules/gradle/actions/GradleTaskTokenProvider.java
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.netbeans.modules.gradle.actions;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.netbeans.modules.gradle.api.GradleTask;
+import org.netbeans.modules.gradle.api.NbGradleProject;
+import org.netbeans.modules.gradle.spi.actions.ReplaceTokenProvider;
+import org.netbeans.spi.project.ProjectServiceProvider;
+import org.openide.util.Lookup;
+
+/**
+ *
+ * @author lkishalmi
+ */
+@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = 
NbGradleProject.GRADLE_PROJECT_TYPE)
+public class GradleTaskTokenProvider implements ReplaceTokenProvider {
+
+    private static Set<String> SUPPORTED = Collections.unmodifiableSet(new 
HashSet(Arrays.asList(
+       "taskName",
+       "taskPath",
+       "taskNames",
+       "taskPaths"
+    )));

Review comment:
       Should be mentioned in `apichanges.xml`, possibly in some generated doc 
for Gradle actions ? Technically it becomes part of API ... or make a comment 
note the tokens are never meant to be used widely.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to