Project: JDT
Bug 77222 Import Selection Dialog Improvements
Reported: 2004-10-28 13:18:14 | Status: resolved fixed

It is very annoying, when importing List, to have to choose which List I want, especially since I nearly ALWAYS choose java.util.List. Specifically, when doing an Organize Imports, a dialog shows up, and it appears to list all of the List classes in alphabetical order by package name. (I think this dialog will show up in other places, but I'm not sure. I know I also see the same list ina different form with QuickFix- Add Import). I envision a number of different ways this list of classes can be improved, but (1) the simplest to use and maybe implement would be to make sort-order pluggable. I can see two variants on sort order that I might like - 1a) Let the user define preferences based on leading package fragments - java.*, before all others 1b) Sort the list based on frequency of use in the current project. This way, over time, the ones I'm using naturally bubble to the top. (2) An additional possibility would be to allow the user to explictly exclude/hide classes they never use. A number of libraries I use might have their own List, which is public, but it's never intended to be used by the clients of the JAR. If I could, over time, build up this knoweldgebase of classes in libraries that I just do not want to see, or very seldom wish to see, the list could be appropriately resticted.

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/AllTypesCache.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeFilter.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeInfoRequestor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SimilarElementsRequestor.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ResultCollector.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocCompletionEvaluator.java