Book a Demo

Author Topic: How to add an "implements" to code gener  (Read 3081 times)

Sergey Woofer

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to add an "implements" to code gener
« on: August 13, 2014, 04:00:38 am »
Hello,

How to add "implements" to code generation (Java for example) without adding an interface?

Java already have a lot of built-in interfaces, I don't need them all in the class diagramm. Just want to have an implements of special class in code generation.

Thanks in advance for help.

« Last Edit: August 13, 2014, 04:01:18 am by subw0fer »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to add an "implements" to code gener
« Reply #1 on: August 13, 2014, 09:04:32 am »
The element menu contains Set parents and Interfaces (or use the keyboard shortcut Ctrl+I)

Sergey Woofer

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to add an "implements" to code g
« Reply #2 on: August 14, 2014, 04:17:49 am »
Thanks, but this is not that I would like to do. This method don't ask which interface I want to implement.

OK, for example I want to generate code like this:

class CallableThread implements Callable<Integer>{

}

What should I do?
« Last Edit: August 14, 2014, 04:18:19 am by subw0fer »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How to add an "implements" to code gener
« Reply #3 on: August 14, 2014, 09:06:31 am »
Select your class
Ctrl+I
Type Callable<Integer> into the class name field.
Select type of Implements
Ensure Accept classifier even if not in model is checked
Click Add
Click Close
Generate code.

Sergey Woofer

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to add an "implements" to code gener
« Reply #4 on: August 15, 2014, 02:15:22 am »
Many thanks! It working like miracle! :)