Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert/Change file headers in Eclipse?

I was using a certain file header for source code in Eclipse (defined in "Code Style") and now I changed it.

Is there a way to either change an existing file's header to the new one, or more simply and likely, just insert a file header to an existing file?

Thanks.

like image 351
Amir Rachum Avatar asked Aug 17 '10 08:08

Amir Rachum


1 Answers

There is a plugin that probably does what you want. I'd recommend checking out the Eclipse Releng tools, available from this update site:

The Eclipse Project Updates - http://download.eclipse.org/eclipse/updates/3.6

One of the tools is the Fix Copyright tool. Using this tool, you can select a project, provide a template (that includes variables such as author, and year of revision, etc). I think there is even a way to have it connect to CVS and automatically update last modified stamps in the template.

This plugin is what many of the Eclipse projects use to keep their headers up to date.

The plugin itself is not documented too well, but it is not hard to use. There is a bit of information here:

http://wiki.eclipse.org/index.php/Platform-releng-faq#How_do_I_use_the_releng_plugin.3F

like image 102
Andrew Eisenberg Avatar answered Nov 16 '22 17:11

Andrew Eisenberg