Reputation: 213
I'm somewhat of a novice programmer, and would like to include some tips in my NetBeans code by building a custom template. However, my tips are... a bit on the long side. I decided to solve that problem by adding a tag above them in one line comments, something like //@Djikstra's
. I want those comments to be automatically folded so that I don't have to scroll through hundreds of lines of code to get to the real code. How should this be done? Pictures below should help illustrate this problem.
This is what one tip looks like in template.
And this is what a tip should look like after auto-generation.
Upvotes: 0
Views: 314
Reputation: 231
It you add an editor fold around a comment, you can make it collapsed by default. For example:
// <editor-fold defaultstate="collapsed" desc="Handy tip">
/* start of comment
This information is useful...
*/
// </editor-fold>
The key here is setting the defaultstate
to collapsed
which causes the comment to be collapsed when the file is first opened.
Upvotes: 1