This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - include default header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - include default header" Watch "Eclipse - include default header" New topic
Author

Eclipse - include default header

Arijit Ghosh
Ranch Hand

Joined: Feb 01, 2002
Posts: 174
Hi,

How can I format my java files to include the copyright header for all files at the click of a button ?

Regards,
Arijit
Ben Poole
Ranch Hand

Joined: Jul 17, 2003
Posts: 33
Why not set up your template code headers in Eclipse?

Window / Preferences

Then, under "Java" select "Code Style" followed by "Code Templates" -- simply set up your "New Java files" template accordingly.
Arijit Ghosh
Ranch Hand

Joined: Feb 01, 2002
Posts: 174
right.. I did that.. I selected create new file... but it did not add any headers...

Also, what if the files already exust ? Say 50 files.. and I want Eclipse check and add if its not present...

Regards,
Arijit
Ben Poole
Ranch Hand

Joined: Jul 17, 2003
Posts: 33
OK, well once you've set up your template, when you create a new class that will get the headers you define. That works for sure.

As for retrospectively updating your source code, I reckon you need a code formatter of some sort, i.e. something more than plain ole' Eclipse. In fact, sounds like a task for Jalopy to me (Jalopy has an Eclipse plug-in too).
 
 
subject: Eclipse - include default header
 
Similar Threads
Insert 2nd class tu main class
jni in linux
"jni_md.h: No such file or directory"- Error Message while compiling C source code
includes with xsl and inc
placing \" in the textfield causes error 500