Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 232287 - allow duplicate code template names if contexts don't overlap
allow duplicate code template names if contexts don't overlap
Status: NEW
Product: editor
Classification: Unclassified
Component: Completion & Templates
: P3 with 1 vote (vote)
Assigned To: Dusan Balek
Depends on: 160771
  Show dependency treegraph
Reported: 2013-07-04 21:30 UTC by athompson
Modified: 2016-01-11 23:01 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2013-07-04 21:30:44 UTC
Issue #160771 introduced the concept of "contexts" into code templates. The next logical step is to allow code templates with the same name so long as the contexts don't overlap.

For example, you could have multiple code templates named "log". If the context is CLASS, it would add a logger instance as a field. If the context is METHOD, it would add a logging statement.

Organized properly, this could vastly reduce the number of template abbreviations developers would need to remember, since related items can be grouped under the same name instead of having to use a unique (and almost by definition harder to remember) name for each template. For example, currently the logger instance must be added with the "logr" abbreviation, which is not obvious.
Comment 1 athompson 2014-12-11 18:24:03 UTC
Still a good idea IMO...
Comment 2 athompson 2016-01-11 23:00:09 UTC

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo