Java如何美化Eclipse IDE中的java代码 [英] Java How to beautify the java code inside Eclipse IDE

查看:186
本文介绍了Java如何美化Eclipse IDE中的java代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse Helios版本作为IDE,并使用
Java开发代码。



对我来说,好的代码是代码运行良好,但是不好的是,代码看起来不太好(我的意思是在if-else语句中使用的控件结构中使用的空格和括号,以及在这里和那里分散的循环)和/或$循环。



我已经使用Ctrl + Shift + F,以及一个在线工具(http://www.prettyprinter.de/)进行格式化,而且看起来更糟糕。



由于很多开发人员都在这里,您如何正确安排代码,以及如何使其看起来不错。



请告诉我我很担心有些高级人员可能会检查代码。

解决方案

尝试更改Window-> Preferences-> Java->代码格式化 - > LineSplittin->最大行长度可达120或140个符号。


I am using Eclipse Helios Version as an IDE and developing code using Java.

The good thing for me is that the code works well, but the bad thing is that the code doesn't look good ( I mean spaces and brackets used in control structures used in if-else statments as well as for and while loops scattered here and there )

I have used Ctrl + Shift + F , as well as an online tool (http://www.prettyprinter.de/) for formatting , and with this it looks more worse.

As a lot of developers are out here, how do you arrange your code properly and how you make it look good.

Please tell me , I am worried as some senior person might review the code .

解决方案

Try to change Window->Preferences->Java->Code Formatter->LineSplittin-> Maximum Line length up to 120 or 140 symbols.

这篇关于Java如何美化Eclipse IDE中的java代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆