12

The title says everything. If I want to add copyright comment in code files in Eclipse Helios, how can I do it? Manually copy-paste or is there any other way?

user
  • 86,916
  • 18
  • 197
  • 190
Tapas Bose
  • 28,796
  • 74
  • 215
  • 331

4 Answers4

10

Go to preferences Java/CodeStyle/Code Templates

then expand Code, and New Java Files, edit that, and put in whatever text you want. Now whenever you create a class, that will be automatically injected.

MeBigFatGuy
  • 28,272
  • 7
  • 61
  • 66
4

Was looking into doing this for my project and found this plugin quite useful

http://www.wdev91.com/?p=cpw_ug

Nirmal Patel
  • 5,128
  • 8
  • 41
  • 52
2

You can also install the Eclipse Releng tools (from the eclipse 3.6 update site included in Helios). I can add copyright headers to existing files and update existing copyright headers to include the current year.

See http://market.eclipsesource.com/yoxos/node/org.eclipse.releng.tools.feature.group for more information.

Paul Webster
  • 10,614
  • 1
  • 25
  • 32
  • Tool doesn't work for me and is severely bugged, only adding IBM copyright, ignoring all other copyright inputs. – Eric Tobias Jan 08 '15 at 10:02
0

The procedure is similar for C++ code in Eclipse CDT: Window:Preferences:C/C++:Code Style:Code Templates:Comments:Files:Edit

The resulting dialog has a button for inserting variables such as time, date, year, file name, etc.

FredZed
  • 1
  • 1