在开发Java时,可以把常用的流程控制建构式或是常用到的API,建立成一个模板,可以加速程序开发。接下来以System.out.println()为例子,来说明如何建立模板:
I. 「Window」→「Preferences」→「Java」→「Editor」→「Templates」
II. 在Preferences窗口按New的按钮
III. 在Name的字段输入自己想要的名称
IV. Context选java
V. 在Description的字段输入简短的说明
VI. 在Pattern的字段输入System.out.println("")后;把光标移到两个双引号的中间,再按下面Insert Variable的按钮,选择cursor
VII. 再按两次OK
这里的${cursor}变量代表插入模板的程序代码后,光标所在的位置。
使用此新模板,打s(或是sop)再按Alt - /,从清单中选sop,再按Enter即可。
分享到:
相关推荐
eclipse-snippets.rar eclipse-snippets.rar eclipse-snippets.rar eclipse-snippets.rar
里面包括 eclipse注释 模板codetemplates.xml, eclipse-formatter.xml直接导入eclipse可以使用。 设置注释模板的入口: Window->Preference->Java->Code Style->Code Template 然后展开Comments节点就是所有需设置...
Eclipse注释模板和格式化模板
程序员必备之一
eclipse注释模板
eclipse codetemplates 格式模板
eclipse 标准 codetemplates.xml 代码模板,标准、简洁、好用
Eclipse Postfix代码完成插件这是对Eclipse的JDT模板系统的扩展,以支持后缀代码完成为了尝试使用此功能,请添加...到Luna Eclipse安装的p2站点,并在类别Postfix代码补全中安装这两个功能。 请同时在查看相应的故障单...
eclipse注释模板文件
MyEclipse/Eclipse自定义模板XM MyEclipse/Eclipse自定义模板XM 直接导入就可以使用了 安装方法: 打开eclipse/myeclipse 选择 window-->Preferences-->JAVA-->Code Style-->Code Templates 右边点Import 选择你写好...
Eclipse注释模板自定义,支持从eclipse.ini配置 copyright、team
Eclipse Java 注释模板,设置后可以使用快捷键快速生成文档注释,版本信息等。
Eclipse 代码注释模板 Eclipse 代码注释模板 Eclipse 代码注释模板 Eclipse 代码注释模板
NULL 博文链接:https://springsfeng.iteye.com/blog/1155990
windows-》preference—》java-》code style-》code template,点击import按钮。 导入成功后,点击comments选项,可以查看各个不同位置的注释,比如...展示样式在Pattern下面的文本框展示。注意只能查看不能修改哈。
__artifactId__.test : eclipse-test-plugin (Fragment project) | |---__artifactId__.site : eclipse-repository生成的插件基于PDE向导中的Hello World模板,使用Eclipse 3.x体系结构: [...] creates a simple ...
eclipse注释模板 xml格式模板 附修改模板方法 和java注释使用方法
NULL 博文链接:https://dolphin-ygj.iteye.com/blog/375039
Eclipse的代码注释模板很丰富,如:user、year、date、time等等,通过在eclipse.ini文件中...使用方法:将xxx_patch.jar里面的文件覆盖eclipse/plugins里面对应包里面当的同目录同名文件。适用版本:eclipse3、eclipse4
打开eclipse中菜单"windows"-->Preferences。 选择“java”-->"Code Style" -->"Organize Imports" ,然后导入。 2、formatter.xml文件,java格式化模板 打开eclipse中菜单"windows"-->Preferences。 选择“java...