Book a Demo

Author Topic: Default language  (Read 8702 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Default language
« on: April 10, 2015, 01:27:26 am »
Is there a way to change the default language applied to a new Class when added to a diagram? I have changed the language of the package from Java the default to a custom language but all the classes are created with Java as the language.

Is it also possible to make a bulk change of the languages for all packages and elements within a model?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Default language
« Reply #1 on: April 10, 2015, 03:23:09 am »
See Tools/Options/Source Code

q.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Default language
« Reply #2 on: April 10, 2015, 07:24:27 pm »
I might be missing something but I don't see how can I do that with Tool/Options/Source Code Engineering (I cannot see Tools/Options/Source Code).

Let me just rephrase what I am after and remove the custom language from the equation. I have a project with various packages; if I choose C# or C, C++, or anything else as the language of the package, EA12 does not inherit the language of the package for each new class in the package, instead it always defaults to Java.

There has to be a way on EA to get classes inheriting the language of the package; I am not expecting to have to change this manually for each new class.
« Last Edit: April 10, 2015, 07:26:18 pm by modesto.vega »

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Default language
« Reply #3 on: April 10, 2015, 07:51:09 pm »
Right click the Package
Select Code Engineering | Reset Options for this Package...


From the resultant dialog

Select Java from the drop down Where Language Is
Select your chosen language from the drop down Convert to
Check the check box Process Child Packages
Click OK

Confirm the change

Please note that is feature will change ALL classes / elements to your chosen language

Phil
Models are great!
Correct models are even greater!

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Default language
« Reply #4 on: April 10, 2015, 07:54:14 pm »
Addition to previous post

Select View | Toolbars from the main menu
Select Code Engineering

Change the setting in the toolbar from Java to your Chosen Language

Now any class you create will be of the language selected in the toolbar, to change the language BEFORE creating the class element, simply change the language in the toolbar

Phil
Models are great!
Correct models are even greater!

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Default language
« Reply #5 on: April 10, 2015, 07:54:32 pm »
Quote
Please note that is feature will change ALL classes / elements to your chosen language
I am assuming that for that package and only for that package, and not for any other packages in a model. Is this correct?

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Default language
« Reply #6 on: April 10, 2015, 07:55:58 pm »
Correct
Models are great!
Correct models are even greater!

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Default language
« Reply #7 on: April 10, 2015, 08:02:46 pm »
It appears to have changed the language of all classes but the only way to check it is to view the properties of each class individually because I cannot add the language of a list view of elements.

However, when I add a new class to the package it still default to Java. It does not inherit the language of the Package.

As much as I love EA, this is starting to get a little annoying because there are more than 100 elements in the model and growing.

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Default language
« Reply #8 on: April 10, 2015, 08:16:14 pm »
Please refer to my second post regarding the Code Engineering toolbar to set thee default language of classes prior to their creation / addition to packages

EA does not show this toolbar by default and the default language is indeed Java

Making this toolbar visible and setting the default language will definitely let you control the language of classes before they are added to a package

Phil
Models are great!
Correct models are even greater!

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Default language
« Reply #9 on: April 10, 2015, 08:32:52 pm »
Sorry I missed your second post, that solves the problem. Although I do think that EA should be smart enough to inherit from the package  :).

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Default language
« Reply #10 on: April 10, 2015, 08:33:15 pm »
You might use a SQL search to list the classes along with their language:

Code: [Select]
SELECT  ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name , GenType FROM t_object
where Name LIKE '*<Search Term>*'

Note: above is for EAP. For most RDBMS use % instead of *

q.
« Last Edit: April 10, 2015, 08:34:18 pm by qwerty »

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Default language
« Reply #11 on: April 13, 2015, 11:35:23 pm »
Quote
You might use a SQL search to list the classes along with their language:

Code: [Select]
SELECT  ea_guid AS CLASSGUID, Object_Type AS CLASSTYPE, Name , GenType FROM t_object
where Name LIKE '*<Search Term>*'

Note: above is for EAP. For most RDBMS use % instead of *

q.
Thanks for the SQL code, is there a way to run SQL inside EAP?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Default language
« Reply #12 on: April 14, 2015, 02:00:42 am »
Ctrl-F
- pre V12:
  - Builder
  - SQL
- V12:
  - Edit search icon (the one with paper/pencil)
  - SQL scratch pad

The above needs to be placed a new SQL search. For testing replace <Search Term> with a manually supplied string.

q.
« Last Edit: April 14, 2015, 02:02:08 am by qwerty »