Author Topic: Hiding Stereotype on specific elements - _HideStype?  (Read 1827 times)

PeteC

  • EA User
  • **
  • Posts: 91
  • Karma: +1/-0
    • View Profile
Hiding Stereotype on specific elements - _HideStype?
« on: March 15, 2023, 09:09:36 pm »
Is the _HideStype attribute intended to hide the stereotype when elements/connectors are created (or have I misunderstood the attribute's use)? The documentation for the attribute states  "Set the 'Initial Value' field to a comma-separated list of stereotypes to hide those stereotypes by setting the 'Hide Stereotyped Features' filter for each new stereotyped model element.". I'm not sure if something also needs to be done with a 'Hide Stereotyped Features' filter in order for it to work, or maybe there is something in the inclusion of the word Features which means the attribute will not have an effect on elements and connectors.

Like Modesto in https://sparxsystems.com/forums/smf/index.php/topic,47123.msg275034.html#msg275034, I want to hide stereotypes on specific elements.

I've added the _HideStype attribute to the metaclass and specified the stereotypes extended from it for which I want to hide their stereotype. But the stereotypes are still shown when elements and connectors are created from the toolbox. I've checked the generated MDG XML and the _HideStype is included in there. I've checked in EA versions 14, 15 and 16 and they all behave the same.

The diagram properties - Elements  - Show Element Stereotypes will globally turn off all element stereotypes but that's not what I want.
The diagram properties - Features - Show Stereotypes option seems to have no effect (stereotypes are shown whether it is enabled or not), but then it's elements and connectors on my diagram and not features.
The diagram properties - Connectors - Show Stereotype Labels will globally turn off all connector stereotypes, but again not what I want.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Hiding Stereotype on specific elements - _HideStype?
« Reply #1 on: March 15, 2023, 10:10:56 pm »
You probably should report a bug including your MDG so they can verify it.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Hiding Stereotype on specific elements - _HideStype?
« Reply #2 on: March 15, 2023, 10:19:46 pm »
Hide Stereotyped feature is specifically about hiding attributes, not about hiding stereotypes labels.

The only way to do that conditionally is to define your own shapescripts.
For connectors you can simply override the correct label (I don't know by heart which one), but for elements you'll have to have the whole thing from scratch.

For most things that's not that difficult (you can start from an existing shapescript; see https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library

Only for Classes that need to show attributes and operations that will be harder.

I usually hide all stereotypes in the diagram settings, but that of course doesn't work when you only want to hide some stereotypes.

Geert