svn commit: r14185 - trunk/src/app/src/org/argouml/uml/ui/PropPanel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-03-09 11:02:03-0800
New Revision: 14185

Modified:
   trunk/src/app/src/org/argouml/uml/ui/PropPanel.java

Log:
Correction on the last commit.

Modified: trunk/src/app/src/org/argouml/uml/ui/PropPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/ui/PropPanel.java?view=diff&rev=14185&p1=trunk/src/app/src/org/argouml/uml/ui/PropPanel.java&p2=trunk/src/app/src/org/argouml/uml/ui/PropPanel.java&r1=14184&r2=14185
==============================================================================
--- trunk/src/app/src/org/argouml/uml/ui/PropPanel.java	(original)
+++ trunk/src/app/src/org/argouml/uml/ui/PropPanel.java	2008-03-09 11:02:03-0800
@@ -33,6 +33,8 @@
 import java.awt.event.ComponentEvent;
 import java.awt.event.ComponentListener;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 
@@ -439,18 +441,24 @@
             }
         }
         if (container instanceof PropPanel) {
-            ((PropPanel) container).collectTargetListenerActions();
+            /* We presume that the container equals this PropPanel. */
+            for (TargetListener action : collectTargetListenerActions()) {
+                list.add(TargetListener.class, action);
+            }
         }
         return list;
     }
 
-    private void collectTargetListenerActions() {
+    private Collection<TargetListener> collectTargetListenerActions() {
+        Collection<TargetListener> set = new HashSet<TargetListener>();
         for (Object obj : actions) {
             if (obj instanceof TargetListener) {
-                listenerList.add(TargetListener.class, (TargetListener) obj);
+                set.add((TargetListener) obj);
             }
         }
+        return set;
     }
+
     /*
      * @see org.argouml.ui.TabTarget#getTarget()
      */
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.