A simple solution would be to compile the current buffer, grep the compilation output for "cannot resolve symbol\nsymbol: class", and then invoke jde-import-find-and-import for each occurrence of them.
Since the same name could refer to different classes, like java.util.Date and java.sql.Date, jde-import-find-and-import may be invoked for different occurrences of the same class name, preferable with the initial selection set to the previous choice. For example, if the user already select java.util.Date for the first Date, the initial choice of subsequent Date shall be java.util.Date instead of java.sql.Date. It would be even better if a customizable user option is provided to control this behaviour. BTW, I vote for this "jde-import-all-interactively" feature. Chang > -----Original Message----- > From: Nick Sieger [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 24, 2002 10:45 AM > To: 'Sandip Chitale'; 'Matthew Rippa' > Cc: 'JDE Mailing List' > Subject: RE: Auto import-collapse > > > > There was some discussion on this some months ago. > > In fact I have written a BCEL based tool to do the expansion > > of import.I think Nick Sieger had started a JDEE extension > to do that > > kind of stuff using my tool.I do not know what is the current > > state of that > > though. Does anyone have any clue ? Is it part of JDEE now ? > > > > Check the following threads - > > > > http://www.mail-archive.com/[email protected]/msg01022.html > > > > http://www.mail-archive.com/[email protected]/msg01127.html > > > > > > -regards, > > sandip > > Unfortunately, the auto-importer I wrote only works if you > already have a > compiled version of that class. It appears that Matt needs to do this > before the first compile. So there needs to be some parsing > of symbols in > the java file in order to automate the import of all > unqualified symbols. > Unfortunately, semantic 1.x does not parse method bodies so > there would have > to be another way to do it. Personally, I use `next-error' > in tandem with > `jde-import-find-and-import' quite a bit. > > Best, > /Nick > > > > > > -----Original Message----- > > > From: Matthew Rippa [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, January 22, 2002 11:14 AM > > > To: JDE Mailing List > > > Subject: Auto import-collapse > > > > > > > > > HI, > > > > > > I know this is just being lazy, but is there a way, after > > > just witing a > > > class, to have the JDEE import and collapse all necessary classes? > > > > > > I seem to be spending "considerable" time using C-c C-v C-z > > > on each class > > > name. --although I coudn't live without that feature! 8-) > > > > > > Thanks for any help, > > > -Matt > > > > > > > >
