views:

828

answers:

2

Wouldn't it be nice to just do a keystroke and have eclipse organize all imports in all java classes instead of just the one you are looking at? Is this possible? Is there a keystroke for it?

+2  A: 

You can edit the clean up options on save to make it organize imports. That way all of your imports will always be organized.

In eclipse 3.4 just go into Window - Preferences. In the tree view look under Java -- Editor -- Save Actions.

This is how I keep my imports organized all of the time.

jjnguy
Awesome I will be adding this stuff to our repositories as well. Thanks
mugafuga
Hey I am using RAD7 and clean up doesn't show up when you filter.. What part of the prefs is this under so I can attempt to find it
mugafuga
look at the edited answer now. that should work better
jjnguy
Arrgh rad 7 doesn't have it bummer
mugafuga
Great stuff. It might save me from RSI.
bmatthews68
+14  A: 

Select the project in the package explorer and press CTRL+SHIFT+O (same keystroke as the single class version). Should work for packages, etc.

Todd
PERFECTO Thanks Todd
mugafuga