Assume we have a class FooCollection
which contains a somewhat long list of static nested classes*:
public class FooCollection {
public static class FooA implements Foo {
// ...
}
public static class FooB implements Foo {
// ...
}
// ...
}
Assume now we have another class using all of these classes. Currently, Eclipse will auto-format this to import each class separately if we reference the class itself
import com.me.FooCollection.FooA;
import com.me.FooCollection.FooB;
import com.me.FooCollection.FooC;
import com.me.FooCollection.FooD;
// and then later something like
callBaz( FooA.class );
What I would prefer to avoid bloating imports and constant commits changing imports due to colleagues using IntelliJ, is having it imported as
import static com.me.FooCollection.*;
However, I can't seem to find anything to get Eclipse to do this. Is there something I am missing or any way to get Eclipse to do it this way?
Edit: I actually just checked and even new FooA()
will still cause the imports to switch back to this, despite setting the start imports threshold.
*) I realize that this is not exactly a good design, but it's a legacy application and for the sake of it let's assume that the code cannot be changed.