30.4.15

Essential tools to manage import statements in Eclipse | Eclipse On E


This is helpful for me:


4. Let Eclipse collapse imports in the same package a wildcard (.*) or always expand them

There isn’t really consensus on whether you should use wildcards on package imports (eg. org.eclipse.swt.*) or whether to specify them individually (eg. org.eclipse.swt.SWT).
By default, Eclipse imports classes individually but you can tell it to always convert them into wildcards:
  1. Go to Window > Preferences > Java > Code Style > Organize Imports.
  2. Change the value of Number of imports need for .* to 0.
  3. (Optional) Change the value of Number of static imports needed for .* to 0.

No comments: