cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1431318 - in /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor: ObjEntityAttributeTab.java ObjEntityRelationshipTab.java
Date Thu, 10 Jan 2013 12:30:15 GMT
Author: aadamchik
Date: Thu Jan 10 12:30:14 2013
New Revision: 1431318

URL: http://svn.apache.org/viewvc?rev=1431318&view=rev
Log:
CAY-1788 javax.swing.table.DefaultTableModel cannot be cast to org.apache.cayenne.modeler.editor.ObjRelationshipTableModel

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java?rev=1431318&r1=1431317&r2=1431318&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeTab.java
Thu Jan 10 12:30:14 2013
@@ -241,6 +241,7 @@ public class ObjEntityAttributeTab exten
      * Selects a specified attribute.
      */
     public void selectAttributes(ObjAttribute[] attrs) {
+        
         ModelerUtil.updateActions(
                 attrs.length,
                 RemoveAttributeAction.class,
@@ -260,6 +261,12 @@ public class ObjEntityAttributeTab exten
     }
 
     public void processExistingSelection(EventObject e) {
+        
+        // hasn't been initialized yet, nothing to do
+        if (!(table.getModel() instanceof ObjAttributeTableModel)) {
+            return;
+        }
+        
         if (e instanceof ChangeEvent) {
             table.clearSelection();
         }

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java?rev=1431318&r1=1431317&r2=1431318&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipTab.java
Thu Jan 10 12:30:14 2013
@@ -246,6 +246,12 @@ public class ObjEntityRelationshipTab ex
     }
 
     public void processExistingSelection(EventObject e) {
+        
+        // hasn't been initialized yet, nothing to do
+        if (!(table.getModel() instanceof ObjRelationshipTableModel)) {
+            return;
+        }
+        
         if (e instanceof ChangeEvent) {
             table.clearSelection();
         }



Mime
View raw message