简体   繁体   English

Eclipse格式化方法调用的快捷方式

[英]Eclipse shortcut to format a method call

Is there any shortcut in Eclipse IDE (Indigo here) to convert from this statement Eclipse IDE(此处为Indigo)中是否有任何快捷方式可从此语句转换

myObject.callMethod(param1, "param2", param3);

into this ? 入这个? :

myObject.callMethod(
   param1, 
   "param2", 
   param3
);

Ctrl-Shift-F is default combination, you can change one via Window -> Preferences -> General -> Keys. Ctrl-Shift-F是默认组合,您可以通过窗口->首选项->常规->键来更改一个。 Check setting at Java -> Code Style also. 还要在Java->代码样式中检查设置。

在窗口->首选项-> Java->代码样式->代码模板中更新代码模板

Ctrl+Shift+F Ctrl + Shift + F

You can see the setting for the formatting under Window->Preferences->Java->Code style->Formatter 您可以在Window-> Preferences-> Java-> Code style-> Formatter下看到格式设置。

You can use Ctrl+Shift+F to format the code. 您可以使用Ctrl + Shift + F设置代码格式。

However in case you want any specific formatting type like spaces instead of tabs then you need to incorporate code formatter from Project > Properties > Java Code Style > Formatter. 但是,如果您想要任何特定的格式设置类型,例如空格而不是制表符,则需要从“项目”>“属性”>“ Java代码样式”>“格式器”中合并code formatter It allows you to define a formatting scheme, export in XML and can be imported on any other machine as well. 它允许您定义格式设置方案,以XML格式导出,也可以在其他任何计算机上导入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM