eclipse--插件

来源:互联网 发布:php开源项目源码 编辑:程序博客网 时间:2024/06/06 05:35

springsource-tool-suite插件:

这个是给eclipse提供的spring插件。
1、首先要知道eclipse的版本信息:
查看eclipse的安装目录下的.eclipseproduct文件。文本格式打开即可看到版本信息。
这里写图片描述

2、查找对应版本插件:
打开地址http://spring.io/tools/sts/all。可以看到提供了下载插件和直接更新两种方式。
这里写图片描述
我们选择直接更新的方式,eclipse的版本是4.2。所以更新站点地址应该是:http://dist.springsource.com/release/TOOLS/update/e4.2/

3、eclipse中按照插件:
Help–>Install New Software–>work with 中输入http://dist.springsource.com/release/TOOLS/update/e4.2/ ,回车等待片刻
这里写图片描述
我们只勾选含有”Spring IDE” 的选项,同时去掉”Contact all update sites during install to find required software”。
然后一路点击“next”、”accept”就可以了。安装完成会重启。
这里写图片描述
可以看到已经安装好了。

4、使用:
创建spring的xml时,右键->new–>other…就可以看到提供了创建选项。选择”Spring Bean Configuration File”。
这里写图片描述

填入文件名称。
这里写图片描述

选择需要引入的XSD namespace。
这里写图片描述

选择完成,就可以看到生成的spring-text.xml文件了
这里写图片描述

当要加入新的XSD namespace时
这里写图片描述

勾选相应的即可。

google代码风格模版:

1、下载模版文件,在 https://code.google.com/p/google-styleguide/source/checkout中通过svn获取eclipse-java-google-style.xml(不愿意麻烦,也可通过csdn下载: http://download.csdn.net/detail/aomandeshangxiao/5209114)

2、引入。Eclipse->window->preferences->Java->Code Style->Formatter->Import 选择eclipse-java-google-style.xml文件。

这里写图片描述

点击apply,ok就行了。这样就可以选中代码进行格式化(默认快捷键是Ctrl+Shift+F)。

点击Edit,对缩进进行修改。把默认修改成4即可:
这里写图片描述

0 0