I didn't explain myself well enough. The stereotype involved is NOT the one on the toolbar. It's one of the antecedents. The one to drag is clear and singular. I would have expected that so long as the dropped metaclass was one of the multiples in the antecedent, it should be OK.
Doesn't matter where you are going to drop the stereotype. If the stereotype on the toolbox can't determine a metaclass when you start a drag it won't work.
<Profile>::<Metatype> is defined as a Class (and ONLY a Class) - via extension. To have to say <Profile>::<Metatype>(UML::Class) is, surely redundant. It still strikes me as a code "smell".
Two points. It's <Profile>::<Stereotype>, not <Profile>::<Metatype>. As I said, if there is only one possible extension it does work it out. The only time (I know of) where it can't work it out for a single extension is if that extension is to an abstract metaclass. The problem is when you omit the extension by habit and are then surprised when it doesn't work when you have more than one. That's why it's recommended to include it explicitly.
OK, my bad on <Profile>::<Stereotype>, vs <Profile>::<Metatype>. (It's force of habit! I thought <Profile>::<Stereotype>, but wrote <Profile>::<Metatype>.)
I think your explanation should be expanded to be clearer... "if there is only one possible extension
all the way up the inheritance hierarchy it does work it out.
Now to figure out how to respecify the toolboxes (and there are MANY) most efficiently!
Paolo
BTW: From the observed behaviour and your explanations, if you have a multiple extension in the hierarchy
[1] it would seem pointless to have to define the toolbox item within the model as a specific metaclass extension since it needs to be overridden at the toolbox in any event. Is that observation correct?
Indeed, we ran a test <Profile>::<Sterotype> is directly defined as a Class (and ONLY a Class) - via extension and thus has the section:
<AppliesTo>
<Apply type="Class">
<Property name="_HideMetaclassIcon" value="true"/>
<Property name="isActive" value=""/>
</Apply>
</AppliesTo>
and yet, if we define the toolbox entry as <Profile>::<Sterotype>(UML::Activity), we will get an Activity. This also smells.
[1] Since we want to achieve commonality of decorations efficiently, it is likely that EVERY toolbox item will have a multi extension at least once in its inheritance hierarchy.