Author: mvw
Date: 2008-02-23 11:58:48-0800
New Revision: 14147

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

Log:
Prevent an exception when right-clicking in the HomeModel field of a diagram 
properties panel.

Modified: trunk/src/app/src/org/argouml/uml/ui/UMLList2.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/ui/UMLList2.java?view=diff&rev=14147&p1=trunk/src/app/src/org/argouml/uml/ui/UMLList2.java&p2=trunk/src/app/src/org/argouml/uml/ui/UMLList2.java&r1=14146&r2=14147
==============================================================================
--- trunk/src/app/src/org/argouml/uml/ui/UMLList2.java  (original)
+++ trunk/src/app/src/org/argouml/uml/ui/UMLList2.java  2008-02-23 11:58:48-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -133,9 +133,11 @@
         Point point = event.getPoint();
         int index = locationToIndex(point);
         JPopupMenu popup = new JPopupMenu();
-        if (((UMLModelElementListModel2) getModel())
-                .buildPopup(popup, index)) {
-            popup.show(this, point.x, point.y);
+        ListModel lm = getModel(); 
+        if (lm instanceof UMLModelElementListModel2) {
+            if (((UMLModelElementListModel2) lm).buildPopup(popup, index)) {
+                popup.show(this, point.x, point.y);
+            }
         }
     }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to