Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » No Context Menu for "Apply Stereotype..." in UML2Tools Class diagram editor
No Context Menu for "Apply Stereotype..." in UML2Tools Class diagram editor [message #528320] Tue, 20 April 2010 07:40 Go to next message
tumer is currently offline tumerFriend
Messages: 6
Registered: April 2010
Junior Member
Hi all, I'm facing this strange problem that after applying a profile to a UML model, I don't see the "Apply Stereotype.." context menu in the Class Diagram editor when right clicking on a class in the diagram. I have several stereotypes defined in the profile whose "Redefined Classifier" is set to <<metaclass>><class>Class (this should make it applicable to UML classes, right?). I also tried with the UML2 Editor, same result: couldn't apply stereotype even with the UML2 Editor.

I've been looking around for a solution for quite some time, but still can't find the cause. Any idea?

I've post this question in the UML2 forum, as I couldn't access the UML2Tools forum in the last few days.


Here's my original post:


this might belong to the "UMLTools" forum, but since it's been not accessible for the last few days, I'll post my question here:

Following the tutorial (MDT-UML2Tools How To Use UML Profiles and Introduction to UML2 Profiles), I tried to apply some stereotypes to a simple model ("ExtendedPO" model). here's what I did:

1) create the model with UML2Tools, resulting in ExtendedPO2.uml and ExtendedPO2.umlclass.
2) create a testing profile "TestProfile" with the UML2Tools, resulting in TestProfile.umlprofile and TestProfile.profile.uml
3) define several stereotypes in the profile, such as "Table" whose Redefined Classifier is "<<metaclass>><class>Class"
this implies that this stereotype should be applicable to UML classes, right?

4) Define the test Profile

5) Now try to apply the profile to my ExtendedPO model

6) Now trying to apply the "Table" stereotype to some class in the model, but I couldn't accomplish this:
6.1) open the model with the UML2Tools diagram editor, when I click on a class in the diagram, I didn't see the "Apply Stereotype" option in the popup menu
6.2) open the model with the UML Editor, click on a class, and go to menu "UML Editor - Element - Apply Stereotyp...", in the coming "Apply Stereotype(s).." dialog, I could find any stereotype no matter what I type in the Filter.

These are the only two ways that I know to apply stereotypes, not sure what was wrong with my procedures.


My profile and model are rather simple, and I'm using Eclipse 3.5.2 with EMF 2.5.0, UML2 Tools 0.9.0
<?xml version="1.0" encoding="UTF-8"?>
<uml:Profile xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_ozBzcEbpEd-zcfmlzYrcTg" name="TestProfile" metamodelReference="_packageImport.0">
  <eAnnotations xmi:id="_5tABQUbpEd-zcfmlzYrcTg" source="http://www.eclipse.org/uml2/2.0.0/UML">
   ...
  </eAnnotations>
  <elementImport xmi:id="_o0hBMEbpEd-zcfmlzYrcTg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
  </elementImport>
  <elementImport xmi:id="_o0hBMUbpEd-zcfmlzYrcTg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
  </elementImport>
  <elementImport xmi:id="_o0hBMkbpEd-zcfmlzYrcTg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
  </elementImport>
  <elementImport xmi:id="_o0hBM0bpEd-zcfmlzYrcTg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
  </elementImport>
  <packageImport xmi:id="_packageImport.0">
    <importedPackage xmi:type="uml:Model" href="pathmap://UML_METAMODELS/UML.metamodel.uml#_0"/>
  </packageImport>
  <packagedElement xmi:type="uml:Stereotype" xmi:id="_zQFoMEbpEd-zcfmlzYrcTg" name="Table" isActive="true">
    <redefinedClassifier xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
    <ownedAttribute xmi:id="_4AOWYEbpEd-zcfmlzYrcTg" name="name">
      <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
    </ownedAttribute>
  </packagedElement>
  <packagedElement xmi:type="uml:Stereotype" xmi:id="_FirHYEbtEd-zcfmlzYrcTg" name="Table2">
    <redefinedClassifier xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Classifier"/>
  </packagedElement>
  <packagedElement xmi:type="uml:Stereotype" xmi:id="_ojds8EgnEd-YsbBI23cu_A" name="Stereotype1"/>
</uml:Profile>



and my model does have the <profileApplication...> element in its definition.



<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_DzZWoUPCEd-7DoTJZHzxNg" name="ExtendedPO2">
  <elementImport xmi:id="_D3kE8EPCEd-7DoTJZHzxNg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
  </elementImport>
  <elementImport xmi:id="_D4Aw4EPCEd-7DoTJZHzxNg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
  </elementImport>
  <elementImport xmi:id="_D4Aw4UPCEd-7DoTJZHzxNg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#UnlimitedNatural"/>
  </elementImport>
  <elementImport xmi:id="_D4Aw4kPCEd-7DoTJZHzxNg">
    <importedElement xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
  </elementImport>
  <packagedElement xmi:type="uml:Class" xmi:id="_UcYiIEPCEd-MBduE5wCakg" name="Supplier">
    <ownedAttribute xmi:id="_scivgEPCEd-MBduE5wCakg" name="name" aggregation="composite">
      <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
    </ownedAttribute>
    <ownedAttribute xmi:id="_mlEX00RcEd-MBduE5wCakg" name="pendingOrders" type="_WY88gEPCEd-MBduE5wCakg" association="_mk6m0ERcEd-MBduE5wCakg">
      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_mlEX1URcEd-MBduE5wCakg" value="*"/>
      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_mlEX1ERcEd-MBduE5wCakg"/>
    </ownedAttribute>
    <ownedAttribute xmi:id="_wqJKZERcEd-MBduE5wCakg" name="shippedOrders" type="_WY88gEPCEd-MBduE5wCakg" association="_wqJKYERcEd-MBduE5wCakg">
      <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_wqJKZkRcEd-MBduE5wCakg" value="*"/>
      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_wqJKZURcEd-MBduE5wCakg"/>
    </ownedAttribute>
    <ownedAttribute xmi:id="_n_qWgEYdEd-spJ8mKEemAQ" name="ID" type="_NBEKoEPDEd-MBduE5wCakg" aggregation="composite"/>
  </packagedElement>
  <packagedElement>
    .......
  </packagedElement>
  <profileApplication xmi:id="_3kkX0EgrEd-YsbBI23cu_A">
    <eAnnotations xmi:id="_3kkX0UgrEd-YsbBI23cu_A" source="http://www.eclipse.org/uml2/2.0.0/UML">
      <references xmi:type="ecore:EPackage" href="TestProfile.profile.uml#_9n-mUUtNEd-y7PM1-ksPMg"/>
    </eAnnotations>
    <appliedProfile href="TestProfile.profile.uml#_ozBzcEbpEd-zcfmlzYrcTg"/>
  </profileApplication>
</uml:Model>

Re: No Context Menu for "Apply Stereotype..." in UML2Tools Class diagram editor [message #534160 is a reply to message #528320] Tue, 18 May 2010 09:13 Go to previous message
tumer is currently offline tumerFriend
Messages: 6
Registered: April 2010
Junior Member
I finally figure out the problem:

I didn't create an extension for my stereotypes.

After creating the extension for the stereotype (as described in the article "Introduction to UML Profiles"), I finally see the "Apply Stereotypes" in the context menu in the UML2 Tools editor.


Still, I have these questions:

1) creating the extension for an Stereotype is only possible via the triditional tree-based "UML Editor". In the graphical UML2 Tools Diagram Editor, there's no place to set or create an extension for a Stereotype. Why? I mean, clicking on a Stereotype in the graphical editor, there's no properties for creating extension in the Properties view. So what's the way for creating extension with the UML2 Tools Editor?

2) after applying the Stereotypes, if I open the model (i.e. a class diagram) with UML2 Tools Editor, the Tagged attributes are not shown in the Properties view.
Note that in the UML Editor, I did see the tagged values in the Properties View.

Can anyone help answering these quesitons? thanks a lot!
Previous Topic:How to create an IMarker in a class-diagram?
Next Topic:No Context Menu for "Apply Stereotype..." in UML2Tools Class diagram editor
Goto Forum:
  


Current Time: Wed Apr 24 16:25:14 GMT 2024

Powered by FUDForum. Page generated in 0.31778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top