I'm using Eclipse on an android project. I updated to Lion and problems began to appear... Trying stuff for hours, no results.
Here is the problem:
I have dozens of files com.stuff.morestuff in my project. I would like to crtl+shift+O my project so every import are resolved. But, on each file, eclipse ask me to resolve ambiguities.
Therefore, I would like to impose to eclipse to choose the first choice.
Some clues
1 - I tried to make rules in the build path, but it's to powerful. Ex: If i exclude android.R from the build path, then it doesn't appear in the choices but I cannot use it explicitly in my code...
2 - Do it manually —> to long
3 - I tried to configure the Organize Import tool, but didn't succeed.
Thank for your answers!
Here are the steps to organising imports whenever you save: Go to Window > Preferences > Java > Editor > Save Actions. Select Perform the selected actions on save (off by default). Ensure that Organize imports is selected (on by default).
Go to the line of unused import, press Ctrl + 1, which is an Eclipse shortcut of a quick fix. This will show a drop-down menu to fix this error and one of them will be “remove unused imports.” It will remove that import statement from the Java file.
Ctrl + D. Deletes current line in the editor. Command + Shift + O. Ctrl + Shift + O. Organize imports in the current java file.
You can use 'Preferences > Java > Appearance > Type Filters'. Create filters for types that you don't want to use. E.g. If you are not interested in types from java.awt package, you can create a filter for the entire package, or you can filter out individual types.
The filtered types are then hidden from the UI, i.e. they are not used in Organize imports or shown in Open Type dialog etc. Note that the types are still visible to the compiler, this is different from fiddling with the build path which will hide the types from the compiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With