At 12:03 PM 5/6/99 +1200, you wrote:
>
>Paul Kinnucan wrote:
>> Actually, this should not be too difficult to implement almost entirely in
>> Java. You can get the classpath from System.properties. For any zip or jar
>> entries on the classpath, you can get easily get all the entries, using the
>> JDK's JarFile class. Thus, the algorithm would be something like:
>
>There doesn't seem to be a JarFile class in JDK 1.1, but ZipFile works fine.
>
>> If anyone is interested in creating such an ImportWizard class, I'd be glad
>
>I've attached the source code to do this. A couple of points I wasn't sure
>about:
>
>1) I've assumed the classpath separator is ':' -- I'm not sure whether this
>should be different for Windows (which uses ';', doesn't it?), or other
>platforms.
>
No problem. I'll modify the code to get the appropriate separator from
java.io.File class.
>2) It currently prints import statements for all matching classes -- you can
>change that by inserting a break in the appropriate place.
>
This is a good idea. I'll modify the code so it returns a list of the
matching classes.
>3) If you want to find the standard classes, you'll need the appropriate
>classes.zip or rt.jar in the classpath. I wasn't sure how to get at those.
>
I'm a bit concerned about the performance hit if you include the JDK files.
Anybody have an idea how many there are?
I wonder how much of a hit there would be if you did not build a database
initially and simply searched the classpath every time.
>You can test if from the command line:
>
>java ImportWizard [multiple class names]
>
>The first class name will be quite slow while the class name database gets
>built.
>
I'll check this out and incorporate it with any necessary changes in the
next JDE release (early next week).
Thanks,
- Paul