Eclipse设置

1、注释设置 

在菜单栏Window--->Preferences--->Java--->Code Style--->Code Templates然后展示Comments节点就是所有需设置注释的元素。

添加注释的快捷键:Alt+Shift+J 或者 右键--->Source--->Generate Element Comment

文件(Files) 注释标签:

/**
* @FileName ${file_name}
* @Package ${package_name}
* @Description ${todo}【用一句话描述该文件做什么】
* @Author 
* @Date ${date} ${time}
* @Version V1.0.1

*/

类(Types)注释标签: 

/**
* @ClassName ${type_name}
* @Description ${todo}【这里用一句话描述这个类的作用】
* @Author 
* @Date ${date} ${time}
${tags}

*/ 

字段(Fields) 注释标签:

/**
* @Fields ${field} ${todo}【用一句话描述这个变量表示什么】
*/

构造函数标签: 

/**
* @Title 
* @Description 
* ${tags}

*/ 

方法(Methods)标签:

/**
* @Title ${enclosing_method}
* @Description ${todo}【这里用一句话描述这个方法的作用】
* ${tags} 
* @Return ${return_type} 返回类型
* @Throws 

*/ 

重写方法(Overriding Methods)标签: 

/**
* @Title ${enclosing_method}
* @Description 
* ${tags}
* ${see_to_overridden}

*/ 

委托方法(Delegate Methods)标签: 

/**
* ${tags}
* ${see_to_target}

*/ 

Getters标签: 

/**
 * @return the ${bare_field_name}

 */ 

Setters标签: 

/**
 * @param ${param} the ${bare_field_name} to set
 */

2、格式化代码设置 

在菜单栏Window--->Preferences--->Java--->Code Style--->Formatter然后点击右侧的Edit进行修改。

3、代码智能提示 

在菜单栏Window--->Preferences--->Java--->Editor--->Content Assist,右侧Auto Activation中Auto activation delay设为1,Auto activation triggers for Java设为.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW。

4、设置代码区背景色 

在菜单栏Window--->Preferences--->General--->Editors--->Text Editors,右侧Appearance color options中Background color设为:色调85 饱和度123 亮度205。

5、设置“空格”和“=”号不上屏

在菜单栏File--->Import--->Plug-in Development--->Plug-ins and Fragmets,选择Import As Projects with source folders,点击“下一步”,选择org.eclipse.jface.text。在Project Explorer视图中修改org.eclipse.jface.text的源码【如果在项目里没有src,则需要下载Eclipse SDK】,选择org.eclipse.jface.text.contentassist,修改CompletionProposalPopup.java文件中下面的代码:

if (contains(triggers, key))
修改为
if (key!=';'&&key!='='&&key!=0x20&& contains(triggers, key))

然后鼠标右键点击org.eclipse.jface.text项目,选择Export--->Plug-in Development--->Deployable plug-ins and fragments。导出后将生成的文件覆盖安装目录中plugins文件夹下的对应文件即可。

6、自动换行 

在菜单栏Help--->Install New Software,选择Add,在“Name”中填入“WordWrap”,“URL”中填入“http://ahtik.com/eclipse-update/” 按照提示安装就可以了。安装完成后,在代码编辑界面点击右键,会出现“WordWrap”属性,将这个属性选上就可以实现自动换行了。

原文地址:https://www.cnblogs.com/sydeveloper/p/3242251.html