You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2020/01/28 10:35:36 UTC
[netbeans] branch master updated: [NETBEANS-3587] Allows creating
stand alone java file in favorites window
This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 802736a [NETBEANS-3587] Allows creating stand alone java file in favorites window
new 47d0116 Merge pull request #1774 from Akshay-Gupta-Oracle/nb_newJavaFile
802736a is described below
commit 802736a75e568e99cea79c65233063f695592065
Author: Akshay Gupta <ak...@oracle.com>
AuthorDate: Fri Dec 13 15:39:29 2019 +0530
[NETBEANS-3587] Allows creating stand alone java file in favorites window
---
.../api/common/singlesourcefile/Description.html | 29 +++++++++++++++
.../api/common/singlesourcefile/File.java.template | 42 ++++++++++++++++++++++
.../api/common/singlesourcefile/package-info.java | 26 ++++++++++++++
3 files changed, 97 insertions(+)
diff --git a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/Description.html b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/Description.html
new file mode 100644
index 0000000..60353de
--- /dev/null
+++ b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/Description.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+ 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.
+
+-->
+<html>
+ <head>
+ <title>New Java File</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ </head>
+ <body>
+ Creates a new Java file.
+ </body>
+</html>
diff --git a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/File.java.template b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/File.java.template
new file mode 100644
index 0000000..e562dea
--- /dev/null
+++ b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/File.java.template
@@ -0,0 +1,42 @@
+<#--
+
+ 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.
+
+-->
+<#assign licenseFirst = "/*">
+<#assign licensePrefix = " * ">
+<#assign licenseLast = " */">
+<#include "${project.licensePath}">
+
+<#if package?? && package != "">
+package ${package};
+
+</#if>
+/**
+ *
+ * @author ${user}
+ */
+public class ${name} {
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]){
+ // TODO code application logic here
+ }
+}
diff --git a/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/package-info.java b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/package-info.java
new file mode 100644
index 0000000..374408c
--- /dev/null
+++ b/java/java.api.common/src/org/netbeans/modules/java/api/common/singlesourcefile/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+@TemplateRegistration(folder = "Other", iconBase = JavaTemplates.JAVA_ICON, displayName = "#JAVAtemplate_displayName", content = "File.java.template", requireProject = false, targetName = "newJavaFile", description = "Description.html", scriptEngine = "freemarker", category = {"java-main-class"})
+
+@Messages(value = "JAVAtemplate_displayName=Java File")
+package org.netbeans.modules.java.api.common.singlesourcefile;
+
+import org.netbeans.api.templates.TemplateRegistration;
+import org.netbeans.spi.java.project.support.ui.templates.JavaTemplates;
+import org.openide.util.NbBundle.Messages;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists