Prefer Certain Packages For Imports

I have 'normal' classes in one package on the classpath and I have associated jaxb classes in a different package also on the classpath.
My problem is that the jaxb classes are alphabetically earlier than the normal classes so they popup first in the Import Class suggestions.
Is there any way to 'prefer' certain packages?
Another example is classes called 'Util'. - There are loads of those in different packages but generally I want one that is in the middle of the import list.

I either want to specify something like "Put com.mypackage.* at the top of the list" or have IDEA remember my most common imports and prioritise them in the list.

1 comment
Comment actions Permalink

Hello opticyclic,

You can exclude the jaxb classes from auto-import. As for the priorities,
IDEA has a number of heuristics to guess which class should be on top of
the import list, but thet aren't currently customizable.

As far as I know statistics is currently not used for ordering auto-import
elements; you're welcome to file an issue requesting that.

I have 'normal' classes in one package on the classpath and I have
associated jaxb classes in a different package also on the classpath.

My problem is that the jaxb classes are alphabetically earlier than
the normal classes so they popup first in the Import Class
suggestions.

Is there any way to 'prefer' certain packages?

Another example is classes called 'Util'. - There are loads of those
in different packages but generally I want one that is in the middle
of the import list.

I either want to specify something like "Put com.mypackage.* at the
top of the list" or have IDEA remember my most common imports and
prioritise them in the list.

---
Original message URL:
http://devnet.jetbrains.net/message/5285901#5285901


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.