[英]Formatting if-else in eclipse
is there any way to format if-else
statement in Eclipse where multiple conditions come in each line while pressing Ctrl + Shift + F ? 有什么方法可以格式化Eclipse中的
if-else
语句,其中在按Ctrl + Shift + F的同时在每一行中都有多个条件? I tried to fiddle around in Preferences -> Java -> Code Style -> Formatter
, but was not able to find the right option to get it working. 我试图在
Preferences -> Java -> Code Style -> Formatter
摆弄,但是找不到正确的选项来使其正常工作。
The format that i am trying to achieve is as follows. 我正在尝试实现的格式如下。
if(condition1 == true
&& condition2 == true
&& condition3 == true
&& condition4 == true
&& condition5 == true) {
return 0;
}
Any suggestions? 有什么建议么?
严格用括号括起来的所有条件都可以。
遗憾的是,您无法使用“代码样式”->“格式化程序”来完成您想做的事情,但是是的,括号内的编写将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.