开发者

How can i make code formatting in netbeans and eclipse equal

开发者 https://www.devze.com 2023-03-08 23:19 出处:网络
How can i make code formatting standards equal in netbeans and eclipse开发者_Go百科 equal. Also is ther is any way that i use eclipse code formatter in netbeans as for netbeans does not format javadoc

How can i make code formatting standards equal in netbeans and eclipse开发者_Go百科 equal. Also is ther is any way that i use eclipse code formatter in netbeans as for netbeans does not format javadocs comments

Abdul Khaliq


Maybe. You have these options:

  1. Configure the formatters to the lowest common denominator (i.e. something that both of them can do). Not sure if that's possible because you can't "switch off" some options.

  2. Eclipse has a feature called "Clean up". Select the project and it becomes available in the "Source" menu. This allows you to clean up certain aspects of a project: Unused imports, formatting, etc. So you save the work in Netbeans and then clean up the project once in a while in Eclipse.

  3. Use an external formatter like Jindent (Commercial but they have a non-commercial license). Create an Ant task to format the code.


If your project uses Maven, you can use this Maven plugin: http://code.google.com/p/maven-java-formatter-plugin/

It uses Eclipse formatting classes to do the format, and can be configured with your Eclipse formatting preferences, see the configFile property here: http://maven-java-formatter-plugin.googlecode.com/svn/site/0.3.1/format-mojo.html

0

精彩评论

暂无评论...
验证码 换一张
取 消