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:
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.
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.
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
精彩评论