Book a Demo

Author Topic: import multiple packages?  (Read 3244 times)

wharley

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
import multiple packages?
« on: June 05, 2006, 02:11:19 pm »
I'm a newbie, evaluating EA.

I have a Java project containing multiple packages.  The source directory structure corresponds to the package hierarchy (as usual for Java).

How can I import all the code at once, into a class diagram?  When I tried importing it only let me do a single directory at a time.  

That is, if the packages were com.x.y.z and com.x.y.q, I was not able to just "import everything under com/x/y", I had to go separately to com/x/y/z and com/x/y/q.  Is there a way around this?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: import multiple packages?
« Reply #1 on: June 05, 2006, 02:40:51 pm »
Hi Wharley,

Open the Import Directory Strcuture dialog - you can reach it from the main menu via Project / Source Code Engineering / Import Source Directory.

You need to check Recursively Process Subdirectories. If you want the EA package strcuture to reflect the directory hierarchy then you probably need to choose the Create Package per Directory option under Package Structure. In any case play around with this.

I suggest you import into a clean, empty project so your prior imports don't cause you grief. Otherwise EA may try to preserve your prior work, depending on various settings.

HTH,
David
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: import multiple packages?
« Reply #2 on: June 05, 2006, 03:12:31 pm »
Midnight is correct, however I would like to add that 'Package per namespace' is usually the best, because the package structure then reflects the structure as it appears in code.  Although with Java the directory structure is generally kept the same as the package structure.

wharley

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: import multiple packages?
« Reply #3 on: June 05, 2006, 03:18:52 pm »
That worked great - thanks!  

Previously I had been creating an empty diagram and then doing Import from Source Files -> Java, which had the problem I described.  The new way works as I'd hoped.