Adding license to new files when using Eclipse and the Copyright wizard plugin
I've just installed this Copyright wizard plugin for managing copyright disclaimers in my Eclipse projects. I discovered it thanks to this post.
I set it up and all works fine:
- I created my own copyright header 开发者_如何转开发
- I used the wizard to apply it to all files of an existing project
Now I have the following problem:
When I create a new file inside the project, the copyright isn't added by default. How can I solve this?
It sounds like you're looking for Eclipse's Code Templates
feature. In the version of Eclipse I have handy, it's found through Preferences -> Java -> Code Style -> Code Templates.
I have a feeling that you will be most interested in either the New Java files
(found under Code) or Files
(found under Comments) template.
There is corresponding functionality for XML files under Preferences -> XML -> XML Files -> Editor -> Templates (look at the xml declaration
template), and for Ant files under Preferences -> Ant -> Editor -> Templates (Buildfile template
). I am willing to bet that there are similar templates for pretty much every other language Eclipse can be used with.
精彩评论