svn commit: r13877 - trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-08 01:58:17-0800
New Revision: 13877

Modified:
   trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java

Log:
Issue 4936: retarget unused class to apply to TagDefinitions instead of Stereotypes

Modified: trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java?view=diff&rev=13877&p1=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java&p2=trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java&r1=13876&r2=13877
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLMetaClassComboBoxModel.java	2007-12-08 01:58:17-0800
@@ -27,7 +27,6 @@
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -35,11 +34,9 @@
 import org.argouml.uml.ui.UMLComboBoxModel2;
 
 /**
- * A model for stereotypes to handle their base class, or as it is a class from
- * the UML metamodel its metaclass.
- * 
- * TODO: This class needs to be replaced with a mechanism that supports multiple
- * base classes as added in UML 1.4.
+ * A model for selecting a UML metaclass. Originally designed for use in
+ * selecting the base class of stereotypes in UML 1.3, but now used to select
+ * the type of a TagDefinition.
  * 
  * @author mkl
  */
@@ -48,11 +45,12 @@
     private List<String> metaClasses;
 
     /**
-     * Constructor.
+     * Construct a default combo box model.
      */
     public UMLMetaClassComboBoxModel() {
-        super("baseClass", true);
-        Collection<String> tmpMetaClasses = Model.getCoreHelper().getAllMetatypeNames();
+        super("tagType", true);
+        Collection<String> tmpMetaClasses =
+                Model.getCoreHelper().getAllMetatypeNames();
         
         if (tmpMetaClasses instanceof List) {
             metaClasses = (List<String>) tmpMetaClasses;
@@ -71,16 +69,10 @@
     /*
      * @see org.argouml.uml.ui.UMLComboBoxModel2#getSelectedModelElement()
      */
+    @Override
     protected Object getSelectedModelElement() {
         if (getTarget() != null) {
-            Collection baseClasses =
-                    Model.getFacade().getBaseClasses(getTarget());
-            if (baseClasses != null) {
-                Iterator iter = baseClasses.iterator();
-                if (iter.hasNext()) {
-                    return iter.next();
-                }
-            }
+            return Model.getFacade().getType(getTarget());
         }
         return null;
     }
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.