java - Eclipse 将每个参数放在新行中,如何停止这种格式化

标签 java android eclipse

Eclipse 以这种方式格式化我的代码,这意味着它将参数放在不同的行中:

nearByLocationsArray = getAddress(      currentLocation.getLatitude(),
                        currentLocation.getLongitude(), 10).toArray(
                        new String[nearbyLocations.size()]);
nearbyLocations = gCoder.getFromLocation(latitude, longitude,
                                maxResults);

但是,我真的不喜欢这样,我想在一行中保持简单:

nearByLocationsArray = getAddress(currentLocation.getLatitude(),currentLocation.getLongitude(), 10).toArray(new String[nearbyLocations.size()]);
nearbyLocations = gCoder.getFromLocation(latitude, longitude,maxResults);

我尝试在格式设置中寻找适当的选项,但找不到,有人可以帮我进行设置吗?

最佳答案

据我所知,不要使用 Ctrl+Shift+F 来格式化在新行中给出每个参数的代码,如果您想将其放在单行中,请检查以下步骤,

简单选择要在单行中显示的行和用户快捷键

Ctrl+Alt+J

希望对你有帮助

关于java - Eclipse 将每个参数放在新行中,如何停止这种格式化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23591731/

相关文章:

java - 使文件写入过程更快

java - 如何使用 Apache PDFBox 将 .png 图像添加到 pdf

java - Apache-camel sftp 使用者错误地使用非 ASCII 字符

java - 如何在 JPA 中创建和处理复合主键

java - 使用 IntelliJ 开发 Eclipse RCP

java - 添加新值时自定义 ListView 值会波动吗?

java - 在一定条件下从firebase数据库中检索数据

android - 下载管理器 : notify when a download is finished

java - Eclipse 控制台中的 H2 数据库结果

java - 优化 Android 中的 HttpURLConnection