This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Have the IDE to reorganize imports automatically and check them automatically (on save).
I propose the following implementation. First this feature will be disabled by default. It can be enabled in Tools->Options->Editing->Java Sources->Import Management Tool Settings. It will work as follow. When save action is invoked on Java source file Import Management Tool is invoked and it will check if there are any unresolved identifiers. If there are all identifiers resolved it ends immediately (without invoking IMT Wizard) and java source file is saved. If there are some unresolved identifiers the IMT starts its Wizard (the same way as it is invoked manually from menu). After Wizards completes the java source file is modified by IMT and then saved. Note that Save action can be invoked implicitly for example by Compile Action or by Exit Action or by renaming package and so on. Alternative solution is to run IMT silently together with automatic source parsing and then somehow (?) notify the user that there are some changes IMT can do. This includes resolving unresolved identifiers, changing usage of fully qualified names to simple names etc.
Tomas, I suggest that for 3.4 you implement the issue as you described (disableed by default, when enabled check the file on Save and bring wizard if needed) and close this request. Then please file a new request for enhancement for more advanced version that would check status of imports when the user is editing source and let's plan this for some next version (4.0).
Import sorting was implemented by issue #19167, automatic invoking of IMT was canceled, since it can irritate lots of users. For more details see this discussion on nbui: http://www.netbeans.org/servlets/ReadMsg?msgId=305091&listName=nbui
We could get back to this in 4.0. I filed: http://www.netbeans.org/issues/show_bug.cgi?id=22843
If this issue was cancelled, shouldn't the proper resolution status be "WONTFIX" or "INVALID" ?
Even if the proposed solution was not implemented (because it irritated users) IMO the requirement is still valid. I would restate it as follows: Assist the user to keep the imports up to date. There can be different solutions then a complex IMT. Please reconsider this and mark it as WONTFIX if you do not plan to support this feature (as Svata suggested). I will not verify that this has been fixed ;-)
Is it possible to resurrect this old issue for 4.0? The eclipse implementation of this is a killer feature. No complex IMT Wizard. Just press a hotkey sequence and: Any unresolved classes for which there exists only one possibility in the classpath gets an import statement. Any unresolved classes for which there exists multiple possibilities in the classpath pop open a quick selection dialog. Any import statements that are not used in the source file are deleted. For extra credit, a configuration option: Number of imports needed for .* (e.g. org.openide.*)
Yes, we would like to address this in 4.0.
Did someone fix this? I just tried the Alt-Shift-F cmd, and this seems to do everything outlined here. Should we mark this fixed?
Yes, thanks for catching this.