如何在Eclipse中格式化时指定类成员的顺序 [英] How to specify the order of class members when formatting in Eclipse

查看:126
本文介绍了如何在Eclipse中格式化时指定类成员的顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse IDE中,如何自定义Java代码样式格式化程序以使其以指定的顺序排序类成员,例如通过可见性对所有实例方法进行分组?

In Eclipse IDE how do you customize the Java code style formatter to have it sort the class members with a specified order, for example to group all instance methods by visibility?

推荐答案

如果问题是如何自定义源 - >格式命令来重新排序成员?,我不认为它可以做到。要更改源 - >排序成员命令使用的顺序,请更改成员排序顺序首选项:窗口 - >首选项 - > Java - >外观 - >成员排序顺序

If the question is, "how do you customize the 'Source -> Format' command to re-order members?", I don't think it can be done. To change the order used for the 'Source -> Sort Members' command, change the "Members Sort Order" preference: "Window -> Preferences -> Java -> Appearance -> Members Sort Order"

这篇关于如何在Eclipse中格式化时指定类成员的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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