Eclipse 块语句前的空行
在eclipse中,是否可以将格式化程序或清理配置为在block语句之前或之后插入空白链接 与此相反:Eclipse 块语句前的空行,eclipse,code-formatting,Eclipse,Code Formatting,在eclipse中,是否可以将格式化程序或清理配置为在block语句之前或之后插入空白链接 与此相反: public class Main { public static void main(String[] args) { if (obj == null) { throw new IllegalArgumentException(); } if (ids.length > 0) { System.out.println(id
public class Main {
public static void main(String[] args) {
if (obj == null) {
throw new IllegalArgumentException();
}
if (ids.length > 0) {
System.out.println(ids[0]);
} else {
return;
}
try {
}
catch( Exception e) {
}
finally {
}
for( int i = 0; i < 10; i++) {
}
switch( p) {
case 0:
fField.set( 0);
break;
case 1: {
break;
}
default:
fField.reset();
}
}
}
公共类主{
公共静态void main(字符串[]args){
if(obj==null){
抛出新的IllegalArgumentException();
}
如果(ids.length>0){
System.out.println(id[0]);
}否则{
返回;
}
试一试{
}
捕获(例外e){
}
最后{
}
对于(int i=0;i<10;i++){
}
开关(p){
案例0:
fField.set(0);
打破
案例1:{
打破
}
违约:
fField.reset();
}
}
}
我想要这个:
public class Main {
public static void main(String[] args) {
if (obj == null) {
throw new IllegalArgumentException();
}
if (ids.length > 0) {
System.out.println(ids[0]);
} else {
return;
}
try {
}
catch( Exception e) {
}
finally {
}
for( int i = 0; i < 10; i++) {
}
switch( p) {
case 0:
fField.set( 0);
break;
case 1: {
break;
}
default:
fField.reset();
}
}
}
公共类主{
公共静态void main(字符串[]args){
if(obj==null){
抛出新的IllegalArgumentException();
}
如果(ids.length>0){
System.out.println(id[0]);
}否则{
返回;
}
试一试{
}
捕获(例外e){
}
最后{
}
对于(int i=0;i<10;i++){
}
开关(p){
案例0:
fField.set(0);
打破
案例1:{
打破
}
违约:
fField.reset();
}
}
}
>看起来不可能看空白行设置(见下面的截图),因为这里没有这样的配置;Eclipse Java代码格式化程序设置在这个中心位置进行配置
但请注意“要保留的空行数”设置!如果空白行是手动添加的,至少它们不会被删除。