Book a Demo

Author Topic: Java package reference types  (Read 4474 times)

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Java package reference types
« on: July 13, 2005, 07:48:32 am »
I've added a class to my logical design which extends the Frame class.  Now I wish to add attribute features which are references to Swing Control types (e.g.; JButton, etc.).  The Type dropdown list does not offer these types.  How do I get them onto the list?

When I reverse engineer a class with Swing references, the Swing types appear.  How does that happen?  

Must I create a class for each control so that EA will display them in the type list?

A generalized response would be helpful for behind this issue is adding the Spring Framework Classes and then packages of my own design.

I'm confused...Am I missing a user document somewhere that describes all of this?  How about a syntax for an XML profile that will accomplish this?

Hum, I've asked a lot of questions...The basic question is "What's the secret to getting popular/well known Java package types into the Java type dropdowns?"

Thanks
Jim
Verbal Use Cases aren't worth the paper they are written upon.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Java package reference types
« Reply #1 on: July 13, 2005, 03:43:37 pm »
The data types that EA provides are only the basic types defined by the language.  The types that are defined in standard libraries need to be added into the model.  We recommend creating a separate part of your model, and importing the relevant parts of the standard libraries to that package.  This can be done from source code, by selecting Project | Source Code Engineering | Import Source Directory.  Alternatively, Java and .Net libraries can be imported from the relevant binary files by selecting Project | Source Code Engineering | Import Binary Module.

This approach provides a few advantages.
  • Package paths for library types are known when generating your code.  Therefore the relevant imports can be generated.
  • You are able to make full use of EA's features showing relationships between library classes and your own.
    If you are experience a slowdown in your model because of the extra classes added, we recommend you remove libraries that you aren't directly using.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Java package reference types
« Reply #2 on: July 13, 2005, 06:08:28 pm »
Not sure I understand the procedure here...

For Java, will EA find the classes in the *.jar files, or must I first extract them?  EA seems to be expecting a specific class file, not a directory name...?

Thanks
Jim
Verbal Use Cases aren't worth the paper they are written upon.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Java package reference types
« Reply #3 on: July 13, 2005, 06:47:15 pm »
EA will directly import from .jar files.

When selecting the file to import, specify Files of type "Java JAR Archive(*.jar;) and select the jar file(s) required.

Simon

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Java package reference types
« Reply #4 on: July 13, 2005, 08:57:21 pm »
Well, pointing at the rt.jar file was an over kill just to get the swing package!  The import has been running for 1.5 hours and is still going!  The only positive is that I'm seeing class names I never knew existed.  There has to be a better way.  Can't I at least specify the packages I need?

Thanks
Jim
Verbal Use Cases aren't worth the paper they are written upon.