4

When I type a . after writing an object instance's name, Eclipse shows a list of all methods available for this instance, including methods of superclasses that the object extends.

If I am working with an object implementing some interface, I have to search for the "interesting" methods among the "boring" Object-level methods such as notify() or getClass().

Can I have Eclipse sort the methods so that the ones declared in subclasses come first?

0

2 Answers 2

6

To change sorting:

Go to Preferences > Java > Editor > Content Assist > Sorting and Filtering.

To filter entries:

Go to Preferences > Java > Appearance > Type filters.

0

Usually we don't use autocompletion to study an objects interface. OK, I sometimes do it, like I want to see all getters - but in that case I just type .get and have a filtered list.

Usually, autocompletion is used to speed up coding - type the first few letters of a method name (for example) and hit return. And this doesn't even need a sorting. (and if, then I really prefer the ascending alphabetically order).

To study the interface, its much better - to my opinion - to take a short break, open the object type in a separate editor and examine the outline view and the java doc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.