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.
For 4.2 apisupport it would be very desirable to be able to hook into the logic of the Fix Imports feature. For example, when searching for possible package locations for an identifier like "ErrorManager", ask all SPI impls in lookup to see if they have any additions. apisupport would notice that ErrorManager is a class provided by org.openide.util; check if the file in question is part of a module project; check if that project did not already have org.openide.util in its dep list; and if so, add one entry to the list of possibilities. This entry would encapsulate the following info: 1. The package should be "org.openide". 2. The entry should be specially marked in the UI, e.g. to include a label such as "[and add dependency on the Utilities API]". 3. When fixing the import, also run a callback provided by apisupport (which would adjust the module's dep list and thus classpath). Is this feasible?
During development of NetBeans Module, its very common to copy portion of code from other modules sources. Of course, there are some imports that are missing. The steps that required to be done after the developer copied the code: Developer need to "Fix imports" If there are any missing dependencies, The "Fix Import" dialog will display the missing variables. User need to switch to project properties-> LIbraries -> Add Module dependencies, click on the "Add" button and type the missing class in the Filter. Again, in the editor, use the "Fix imports" . It will be a great value to have it in a single action (i.e "Fix imports" action will also add the missing dependencies to the project)
Done as a separate hint for Maven projects: maven.hints/src/org/netbeans/modules/maven/hints/errors/SearchClassDependencyInRepo.java