svn commit: r19070 - trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/ActionNewTagDefinition.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2011-02-24 01:12:08-0800
New Revision: 19070

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/ActionNewTagDefinition.java

Log:
UML2: correctly build tag definition with String as default type

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/ActionNewTagDefinition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/ActionNewTagDefinition.java?view=diff&pathrev=19070&r1=19069&r2=19070
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/ActionNewTagDefinition.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/ActionNewTagDefinition.java	2011-02-24 01:12:08-0800
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *    bobtarling
+ *    Thomas Neustupny
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -86,12 +87,21 @@
         } else {
             namespace = Model.getFacade().getInnerContainingModel(t);
         }
-        Object newTagDefinition = Model.getExtensionMechanismsFactory()
-            .buildTagDefinition(
-                    (String) null,
-                    owner,
-                    namespace
-            );
+        Object newTagDefinition = null;
+        if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
+            newTagDefinition = Model.getExtensionMechanismsFactory()
+                .buildTagDefinition((String) null, owner, namespace);
+        } else {
+            Object type = null;
+            for (Object aType : Model.getExtensionMechanismsHelper()
+                    .getCommonTaggedValueTypes()) {
+                if ("String".equals(Model.getFacade().getName(aType))) {
+                    type = aType;
+                    break;
+                }
+            }
+            newTagDefinition = Model.getCoreFactory().buildAttribute2(t, type);
+        }
         TargetManager.getInstance().setTarget(newTagDefinition);
         super.actionPerformed(e);
     }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2707142

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.