Author Topic: Change attribute type menu  (Read 645 times)

Yoda33

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Change attribute type menu
« on: December 15, 2017, 07:07:02 pm »
When I add an attribute to an element the type defaults to 'int'.
1. Can I change default to 'string' (or something else)?
2. Can I add extra elementary types (e.g. date, datetime) to the default list?
    (I know I can 'Select type', but that is tedious for common types)

(EA version 13.5)

Thanks.
« Last Edit: December 15, 2017, 07:12:12 pm by Yoda33 »

qwerty

  • EA Guru
  • *****
  • Posts: 9667
  • Karma: +176/-150
  • I'm no guru at all
    • View Profile
Re: Change attribute type menu
« Reply #1 on: December 15, 2017, 07:11:33 pm »
You can just type any text you like. When I add a couple of attributes I just paste the "string" or "String" if that's the name, or type "str" if it's that.

q.

Yoda33

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Change attribute type menu
« Reply #2 on: December 15, 2017, 07:17:38 pm »
Thanks qwerty.
I am really lazy (and a poor typist).
I would really like to extend the menu.
There seem to be a lot of text configuration files under the install directory.
I was hoping to hack one of these.

qwerty

  • EA Guru
  • *****
  • Posts: 9667
  • Karma: +176/-150
  • I'm no guru at all
    • View Profile
Re: Change attribute type menu
« Reply #3 on: December 15, 2017, 08:28:57 pm »
Project / Settings / Code Engineering: Select Java (or which is your default language) and add what you need. It will appear in the list.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8467
  • Karma: +207/-26
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Change attribute type menu
« Reply #4 on: December 15, 2017, 09:10:40 pm »
but whatever you do, "int" will always be the default  :-X

Geert

Yoda33

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Change attribute type menu
« Reply #5 on: December 16, 2017, 04:22:10 am »
@qwerty -  thanks for letting me know it is possible
On my version (13.5), it took me a while to find the dialogues.

On the 'Configure' tab, there is a section called 'Reference Data' with a 'Settings' menu.
I selected the 'Code Engineering Datatypes...' option.
This displays the 'Programming Languages Datatypes' dialogue.
Choosing product 'Java', I was able to add new datatypes as required.

To change the default language:  'Configure' tab | section 'Model' | Options | Source Code Engineering - and choose the desired language.

@geert - you're right
I fixed that with an addin (using your example code - thanks).
Unfortunately, my clients IT department does not easily allow installation of unofficial executables. (Fair enough).

Anyway, thank you both.  :)