svn commit: r13713 - trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2007-11-03 20:36:50-0700
New Revision: 13713

Modified:
   trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java

Log:
The debug tree for the Dev Module in EUML model implementation (see issue 4878).

Modified: trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&rev=13713&p1=trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&r1=13712&r2=13713
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	2007-11-03 20:36:50-0700
@@ -44,6 +44,7 @@
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.DeleteInstanceEvent;
+import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
 import org.eclipse.emf.common.command.CommandStackListener;
 import org.eclipse.emf.common.notify.Notification;
@@ -52,6 +53,7 @@
 import org.eclipse.emf.ecore.ENamedElement;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.resource.Resource;
 
 /**
  * The implementation of the ModelEventPump for eUML.
@@ -467,9 +469,33 @@
         return name;
     }
 
+    @SuppressWarnings("unchecked")
     public List getDebugInfo() {
-        // TODO: Auto-generated method stub
-        return Collections.EMPTY_LIST;
+        List info = new ArrayList();
+        info.add("Event Listeners"); //$NON-NLS-1$
+        for (Iterator it = registerForElements.entrySet().iterator(); 
+                it.hasNext(); ) {
+            Map.Entry entry = (Map.Entry) it.next();
+            String item = entry.getKey().toString();
+            List modelElementNode = newDebugNode(item);
+            info.add(modelElementNode);
+            List listenerList = (List) entry.getValue();
+            for (Iterator listIt = listenerList.iterator(); 
+                    listIt.hasNext();) {
+                Listener listener = (Listener)listIt.next();
+                List listenerNode =
+                    newDebugNode(
+                            listener.getListener().getClass().getName());
+                modelElementNode.add(listenerNode);
+            }
+        }
+        return info;
+    }
+       
+    private List newDebugNode(String name) {
+        List list = new ArrayList();
+        list.add(name);
+        return list;
     }
 
 }
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.