# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /Users/beci/source/web-main-def # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: openide.loaders/src/org/netbeans/api/templates/TemplateRegistration.java --- openide.loaders/src/org/netbeans/api/templates/TemplateRegistration.java +++ openide.loaders/src/org/netbeans/api/templates/TemplateRegistration.java @@ -131,4 +131,10 @@ * @since 7.46 */ boolean requireProject() default true; + + /** + * Set default new name of the instance + * @return + */ + String defaultName() default ""; } Index: openide.loaders/src/org/netbeans/modules/templates/TemplateProcessor.java --- openide.loaders/src/org/netbeans/modules/templates/TemplateProcessor.java +++ openide.loaders/src/org/netbeans/modules/templates/TemplateProcessor.java @@ -115,6 +115,9 @@ if (!t.displayName().isEmpty()) { f.bundlevalue("displayName", t.displayName()); } + if (!t.defaultName().isEmpty()) { + f.bundlevalue("defaultName", t.defaultName()); + } if (!t.iconBase().isEmpty()) { builder.validateResource(t.iconBase(), e, t, "iconBase", true); f.stringvalue("iconBase", t.iconBase()); Index: projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java --- projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java +++ projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java @@ -179,7 +179,11 @@ } putClientProperty ("NewFileWizard_Title", displayName);// NOI18N if (template != null) { - final String baseName = isFolder ? LBL_folder_name() : LBL_SimpleTargetChooserPanelGUI_NewFilePrefix() + template.getName (); + Object defaultNameAttr = template.getAttribute("defaultName"); + String defaultName = defaultNameAttr == null || defaultNameAttr.toString().isEmpty() ? + LBL_SimpleTargetChooserPanelGUI_NewFilePrefix() + template.getName () : + defaultNameAttr.toString(); + final String baseName = isFolder ? LBL_folder_name() : defaultName; if (documentName == null) { documentName = baseName; }