This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Files that are not templates and are located in Templates folder structure should not be displayed in the new from template.
I have not seen such a problem. E.g. apisupport has tons of files which are under Templates/ which are not marked as templates, only for use in .group's. They do not appear. [3.2 release]
Create under userdirectory folder system/Templates/Other and copy to this folder a java source file. Then invoke in the explorer context menu on some directory and expand New | Other. Now in this submenu there will be one item, the java source you added above and when selecting it, nothing happens. Note, in the new from template dialog isn't the java source displayed.
Yes, quite true--just the popup menu is broken.
Taking this.
Suggested fix: Changes in NewTemplateAction.java: Overload createNodes method in inner class TemplateChildren, filter non-templates instances. Remove copyNode method, there is no need of this method. Index: NewTemplateAction.java =================================================================== RCS file: /usr/local/tigris/data/helm/cvs/repository/openide/src/org/openide/actions/NewTemplateAction.java,v retrieving revision 1.48 diff -u -r1.48 NewTemplateAction.java --- NewTemplateAction.java 2001/08/02 08:02:50 1.48 +++ NewTemplateAction.java 2001/09/07 08:41:48 @@ -421,17 +421,27 @@ public TemplateChildren (Node or) { super (or); } - - protected Node copyNode (Node n) { - DataFolder df = (DataFolder)n.getCookie (DataFolder.class); - if (df == null || df.isTemplate ()) { - // on normal nodes stop recursion - return new FilterNode (n, LEAF); - } else { - // on folders use normal filtering - return new FilterNode (n, new TemplateChildren (n)); + + /** Creates nodes for nodes. + */ + protected Node[] createNodes (Object key) { + Node n = (Node)key; + + DataObject obj = (DataObject)n.getCookie (DataObject.class); + if (obj != null) { + if (obj.isTemplate ()) { + // on normal nodes stop recursion + return new Node[] { new FilterNode (n, LEAF) }; + } + + if (acceptObj (obj)) { + // on folders use normal filtering + return new Node[] { new FilterNode (n, new TemplateChildren (n)) }; + } } + return new Node[] {}; } + } }
Fixed in NewTemplateAction 1.49.
verified dev#20010910
Resolved for 3.4.x or earlier, no new info since then -> closing.