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.

Bug 123167 - Support for insert/generate code from templates
Summary: Support for insert/generate code from templates
Status: RESOLVED WONTFIX
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Martin Janicek
URL: http://wiki.netbeans.org/wiki/view/Gr...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-30 17:08 UTC by schmidtm
Modified: 2013-11-16 22:51 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description schmidtm 2007-11-30 17:08:15 UTC
This Groovy editor feature should enable a similar feature as found in the Java-Editor. The user can (context-aware)
insert constructore, getters, setters and the like into the Groovy code.
Comment 1 Martin Janicek 2013-04-23 08:39:44 UTC
Closing this issue because at the moment I can't imagine real use case. Groovy don't need to generate constructors/getters/setters. They are all added by groovy itself..
Comment 2 Ryoga 2013-11-16 22:50:31 UTC
(In reply to Martin Janicek from comment #1)
> Closing this issue because at the moment I can't imagine real use case.
> Groovy don't need to generate constructors/getters/setters. They are all
> added by groovy itself..

I am dying for this feature! Currently, I need to use Java 'scratch' files to use these features, and then copy and paste the results into my respective Groovy files. Use cases include but are not limited to:

1. Contructors/Getters/Setters: Yes, it's true Groovy generates them, but the ones Groovy generates aren't always desirable. I like to use groovy to develop immutable and/or functional data structures; While I like what it offers when writing program logic, I don't like what it offers with regards to scaffolding. In other words, not all design patterns are facilitated (and some are in fact hampered) by groovy's scaffolding. I'd much rather have NetBeans generate method signatures (ie. replace the bodies) for me than me having to write them out myself.

2. Delegate Method, Override Method: desperately desired! I use these extensively when decorating objects and implementing adapters/facades

3. Add Property: Another situation where I keep the method signatures and replace their bodies with new code.