You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/03/27 10:05:17 UTC

[GitHub] [incubator-netbeans] sarveshkesharwani commented on a change in pull request #1171: Integration of JEP-330

sarveshkesharwani commented on a change in pull request #1171: Integration of JEP-330
URL: https://github.com/apache/incubator-netbeans/pull/1171#discussion_r269483663
 
 

 ##########
 File path: java/java.source/src/org/netbeans/api/java/source/support/SingleJavaSourceRunActionProvider.java
 ##########
 @@ -0,0 +1,126 @@
+/*
+ * 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.api.java.source.support;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Future;
+import org.openide.filesystems.FileObject;
+import org.netbeans.api.extexecution.ExecutionDescriptor;
+import org.netbeans.api.extexecution.ExecutionService;
+import org.netbeans.api.project.FileOwnerQuery;
+import org.netbeans.api.project.Project;
+import org.netbeans.modules.java.JavaNode;
+import org.netbeans.spi.project.ActionProvider;
+import org.openide.loaders.DataObject;
+import org.openide.util.Lookup;
+import org.openide.util.NbPreferences;
+import org.openide.util.Utilities;
+import org.openide.util.lookup.ServiceProvider;
+
+/**
+ * This class provides support to run a single Java file without a parent
+ * project (JEP-330).
+ *
+ * @author Sarvesh Kesharwani
+ */
+@ServiceProvider(service = ActionProvider.class)
+public class SingleJavaSourceRunActionProvider implements ActionProvider {
 
 Review comment:
   Thanks for the review @JaroslavTulach . My first instinct was to add this via @ActionReference too, but here, I am making use of the "Run File" which is already added to Project UI's layer. (which is also present for a single file). So, now, if I create a new action with the annotation, wouldn't it mean that we would have two run menus (one for the new action, and the other disabled "Run File")?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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