如何为 Eclipse Helios 添加版权?
标题说明了一切。如果我想在Eclipse Helios中的代码文件中添加版权注释,我该怎么做?手动复制粘贴还是有其他方法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
转到首选项 Java/CodeStyle/Code Templates,
然后展开 Code 和 New Java Files,对其进行编辑,然后输入所需的任何文本。现在,每当您创建一个类时,都会自动注入该类。
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.
正在考虑为我的项目执行此操作,发现这个插件非常有用
http://www.wdev91.com/ ?p=cpw_ug
Was looking into doing this for my project and found this plugin quite useful
http://www.wdev91.com/?p=cpw_ug
您还可以安装 Eclipse Releng 工具(来自 Helios 中包含的 eclipse 3.6 更新站点)。我可以向现有文件添加版权标头并更新现有版权标头以包含当前年份。
请参阅 http://market.eclipsesource.com/yoxos/ node/org.eclipse.releng.tools.feature.group 了解更多信息。
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.
该过程与 Eclipse CDT 中的 C++ 代码类似:
窗口:首选项:C/C++:代码样式:代码模板:注释:文件:编辑
生成的对话框有一个用于插入变量(例如时间、日期、年份、文件名等)的按钮。
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.