Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of methods generated by the IDE. When editing the template,
the following predefined variables, that will be then expanded into
the corresponding values, could be used together with Java expressions and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
${licenseFirst!""}
${licensePrefix}Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
${licensePrefix}Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template
${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
${licensePrefix}Ctrl/Cmd+Click nbfs://nbhost/SystemFileSystem/${.data_model["org.openide.filesystems.FileObject"].getPath()} to edit this template

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ctrl/Cmd sounds horrible. I don't have Cmd on my keyboard! Would See nbfs:/.... work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem was that many didn't know how to click the link as seen in issues and on the mailing list. I don't have Cmd either. If I wouldn't have added it someone would have commented that they had no Ctrl on their kb.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed the complaint on mailing list as well. Yes, we have a usability problem.

I don't have Cmd either. If I wouldn't have added it someone would have commented that they had no Ctrl on their kb.

Probably a sign that the user experience deserves deeper fix than Ctrl/Cmd prefix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be a sign. But maybe its sufficient to explain how the link works at least until someone is interested to implement a deeper fix.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to point out that users not knowing how to "click" in the editor (e.g. with Ctrl or Cmd) probably don't know how to navigate to symbol definitions either! "Addressing" just the URL problem without fixing the underlying usability issue makes little sense to me.

I am fine with some rewording - for example Visit nbfs:... or Navigate to nbfs: - and then letting the user intelligence work - but I find Ctrl/Cmd+Click so ugly, that I cannot adore it... even if it helped even a single user.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Visit nbfs:..., and possibly thinking about better ways of guiding the user into how to click things separately.

${licenseLast!""}
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void testCloneableWithoutClone() throws Exception {
"public class CloneTest4 implements Cloneable {\n" +
" @Override\n" +
" public Object clone() throws CloneNotSupportedException {\n" +
" return super.clone(); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody\n" +
" return super.clone();\n" +
" }\n" +
"}"
);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testImplementAllMethodsForEnums() throws Exception {
"public enum Test implements Runnable {\n" +
" A;\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n" +
"}\n").replaceAll("[ \t\n]+", " "));
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public void test204252b() throws Exception {
("package test;\n" +
"public class Test implements Runnable {\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n" +
"}\n").replaceAll("[ \t\n]+", " "));
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public void test178153a() throws Exception {
"public enum Test implements Runnable {\n" +
" A {\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n" +
" };\n" +
"}\n").replaceAll("[ \t\n]+", " "));
Expand All @@ -143,7 +143,7 @@ public void test178153b() throws Exception {
" A { public void run() {} },\n" +
" B {\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n" +
" };\n" +
"}\n").replaceAll("[ \t\n]+", " "));
Expand All @@ -164,7 +164,7 @@ public void testEnumWithAbstractMethods() throws Exception {
"\n" +
" @Override\n" +
" public int boo() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n" +
" };\n" +
" public abstract int boo();\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testSimple1() throws Exception {
.assertOutput("package test;\n" +
"public abstract class Test implements Runnable {\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n" +
"}\n");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of methods generated by the IDE. When editing the template,
the following predefined variables, that will be then expanded into
the corresponding values, could be used together with Java expressions and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of lambda expressions generated by the IDE. When editing
the template, the following predefined variables, that will be then expanded
into the corresponding values, could be used together with Java expressions and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of overridden methods generated by the IDE. When editing
the template, the following predefined variables, that will be then expanded
into the corresponding values, could be used together with Java expressions and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ public CompletableFuture<ApplyWorkspaceEditResponse> applyEdit(ApplyWorkspaceEdi
fileChanges.get(0).getRange());
assertEquals("\n" +
" private String convertToString(int value) {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n",
fileChanges.get(0).getNewText());
}
Expand Down Expand Up @@ -2167,7 +2167,7 @@ public CompletableFuture<ApplyWorkspaceEditResponse> applyEdit(ApplyWorkspaceEdi
assertEquals("\n" +
" @Override\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n",
fileChanges.get(0).getNewText());
}
Expand Down Expand Up @@ -2257,7 +2257,7 @@ public CompletableFuture<ApplyWorkspaceEditResponse> applyEdit(ApplyWorkspaceEdi
fileChanges.get(0).getRange());
assertEquals(" @Override\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n",
fileChanges.get(0).getNewText());
}
Expand Down Expand Up @@ -2345,7 +2345,7 @@ public CompletableFuture<ApplyWorkspaceEditResponse> applyEdit(ApplyWorkspaceEdi
fileChanges.get(0).getRange());
assertEquals(" @Override\n" +
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\");\n" +
" }\n",
fileChanges.get(0).getNewText());
}
Expand Down Expand Up @@ -3320,12 +3320,12 @@ public CompletableFuture<List<QuickPickItem>> showQuickPick(ShowQuickPickParams
assertEquals("\n" +
" @Override\n" +
" protected void finalize() throws Throwable {\n" +
" super.finalize(); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody\n" +
" super.finalize();\n" +
" }\n" +
"\n" +
" @Override\n" +
" public String toString() {\n" +
" return super.toString(); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody\n" +
" return super.toString();\n" +
" }\n",
fileChanges.get(0).getNewText());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ public void test232199a() throws Exception {
"package test; public class Test implements I { } interface I { public default void t() { } } \n",
"1.8",
new T2(),
new ContentValidator("package test; public class Test implements I { \n\n @Override\n public void t() {\n I.super.t(); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody\n }\n } interface I { public default void t() { } } \n"),
new ContentValidator("package test; public class Test implements I { \n\n @Override\n public void t() {\n I.super.t();\n }\n } interface I { public default void t() { } } \n"),
false);
}

Expand All @@ -1498,7 +1498,7 @@ public void test232199b() throws Exception {
"package test; public interface Test extends I { } interface I { public void t(); } \n",
"1.8",
new T2(),
new ContentValidator("package test; public interface Test extends I { \n\n @Override\n public default void t() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n }\n } interface I { public void t(); } \n"),
new ContentValidator("package test; public interface Test extends I { \n\n @Override\n public default void t() {\n throw new UnsupportedOperationException(\"Not supported yet.\");\n }\n } interface I { public void t(); } \n"),
false);
}

Expand All @@ -1507,7 +1507,7 @@ public void test232199c() throws Exception {
"package test; public interface Test extends I { } interface I { public default void t() { } } \n",
"1.8",
new T2(),
new ContentValidator("package test; public interface Test extends I { \n\n @Override\n public default void t() {\n I.super.t(); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody\n }\n } interface I { public default void t() { } } \n"),
new ContentValidator("package test; public interface Test extends I { \n\n @Override\n public default void t() {\n I.super.t();\n }\n } interface I { public default void t() { } } \n"),
false);
}

Expand All @@ -1516,7 +1516,7 @@ public void test232199d() throws Exception {
"package test; public class Test implements I { } interface I { public void t(); } \n",
"1.8",
new T2(),
new ContentValidator("package test; public class Test implements I { \n\n @Override\n public void t() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody\n }\n } interface I { public void t(); } \n"),
new ContentValidator("package test; public class Test implements I { \n\n @Override\n public void t() {\n throw new UnsupportedOperationException(\"Not supported yet.\");\n }\n } interface I { public void t(); } \n"),
false);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of methods generated by the IDE. When editing the template,
the following predefined variables, that will be then expanded into
the corresponding values, could be used together with Java expressions and
Expand All @@ -10,4 +10,4 @@ ${method_name} name of the created method
${class_name} qualified name of the enclosing class
${simple_class_name} simple name of the enclosing class
-->
throw new java.lang.UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
throw new java.lang.UnsupportedOperationException("Not supported yet.");
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of lambda expressions generated by the IDE. When editing
the template, the following predefined variables, that will be then expanded
into the corresponding values, could be used together with Java expressions and
Expand All @@ -9,7 +9,6 @@ ${default_return_value} a value returned by the method by default
${method_name} name of the functional interface method
-->
<#if method_return_type?? && method_return_type != "void">
return ${default_return_value}; // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/LambdaBody
return ${default_return_value};
<#else>
// Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/LambdaBody
</#if>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<#--
A built-in Freemarker template (see http://freemarker.sourceforge.net) used for
A built-in Freemarker template (see https://freemarker.apache.org/) used for
filling the body of overridden methods generated by the IDE. When editing
the template, the following predefined variables, that will be then expanded
into the corresponding values, could be used together with Java expressions and
Expand All @@ -12,7 +12,7 @@ ${class_name} qualified name of the enclosing class
${simple_class_name} simple name of the enclosing class
-->
<#if method_return_type?? && method_return_type != "void">
return ${super_method_call}; // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody
return ${super_method_call};
<#else>
${super_method_call!''}; // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody
${super_method_call!''};
</#if>