>>>>> "Allan" == Allan Brighton <[EMAIL PROTECTED]> writes:
Allan> Hi all,
Allan> Is there a tool around to automatically generate java import
Allan> statements. I know about the JDE import wizard, but I am
Allan> thinking about something more: Something that will scan a
Allan> source file and either print out or insert the import
Allan> statements.
Allan> I'm often lazy and write things like:
Allan> import mypackage.*;
Allan> But in the end, I would like to have it automatically
Allan> expanded to:
Allan> import mypackage.MyClass1; import mypackage.MyClass2; ...
Allan> This makes it easier for other people to find out where the
Allan> classes are and helps to avoid conflicts.
Allan> As far as I understand it, the import wizard makes you type
Allan> the package name. It would be better to use the
Allan> global-class-path variable to search for it...
The old version of the jde-import command did require a
fully qualified class name. Since about version 2.1.6b5 however it has
been able to qualify the name by er...searching the global-class-path
variable. It also uses the magical "thingatpoint" package which means
that if you have already written the type declaration in, and then use
C-cC-vC-z you will not have to type it again. The beta version is
quite stable, so you should probably try that if you have not already.
It would be nice to have code for the JDE which automatically
scans the entire buffer and works out which types need importing, and
possibly also which dont need importing but have been. Perhaps once
Paul has got the parser support up and running this will become fairly
simple?
Phil