cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1510002 - /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/RemoveAction.java
Date Sat, 03 Aug 2013 14:45:57 GMT
Author: aadamchik
Date: Sat Aug  3 14:45:57 2013
New Revision: 1510002

URL: http://svn.apache.org/r1510002
Log:
CAY-1857  Problem with hotkeys

patch by Ilya

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/RemoveAction.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/RemoveAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/RemoveAction.java?rev=1510002&r1=1510001&r2=1510002&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/RemoveAction.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/RemoveAction.java
Sat Aug  3 14:45:57 2013
@@ -46,7 +46,6 @@ import org.apache.cayenne.map.DbRelation
 import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.EmbeddableAttribute;
 import org.apache.cayenne.map.Entity;
-import org.apache.cayenne.map.LifecycleEvent;
 import org.apache.cayenne.map.ObjAttribute;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.ObjRelationship;
@@ -62,9 +61,11 @@ import org.apache.cayenne.map.event.Rela
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.dialog.ConfirmRemoveDialog;
+import org.apache.cayenne.modeler.editor.CallbackType;
 import org.apache.cayenne.modeler.editor.ObjCallbackMethod;
 import org.apache.cayenne.modeler.event.CallbackMethodEvent;
 import org.apache.cayenne.modeler.undo.RemoveAttributeUndoableEdit;
+import org.apache.cayenne.modeler.undo.RemoveCallbackMethodUndoableEdit;
 import org.apache.cayenne.modeler.undo.RemoveCompoundUndoableEdit;
 import org.apache.cayenne.modeler.undo.RemoveRelationshipUndoableEdit;
 import org.apache.cayenne.modeler.undo.RemoveUndoableEdit;
@@ -414,12 +415,12 @@ public class RemoveAction extends Cayenn
 	private void removeMethods(ProjectController mediator,
 			ConfirmRemoveDialog dialog, ObjCallbackMethod[] methods) {
     	CallbackMap callbackMap = mediator.getCurrentObjEntity().getCallbackMap();
-    	LifecycleEvent callbackType = mediator.getCurrentCallbackType().getType();
+    	CallbackType callbackType = mediator.getCurrentCallbackType();
 
         if ((methods.length == 1 && dialog.shouldDelete("callback method", methods[0].getName()))
         	|| (methods.length > 1 && dialog.shouldDelete("selected callback methods")))
{
             for (ObjCallbackMethod callbackMethod : methods) {
-            	callbackMap.getCallbackDescriptor(callbackType).removeCallbackMethod(callbackMethod.getName());
+            	callbackMap.getCallbackDescriptor(callbackType.getType()).removeCallbackMethod(callbackMethod.getName());
                     
                 CallbackMethodEvent ce = new CallbackMethodEvent(
                         this,
@@ -429,6 +430,9 @@ public class RemoveAction extends Cayenn
                     
                 mediator.fireCallbackMethodEvent(ce);
             }
+            
+            Application.getInstance().getUndoManager().addEdit( 
+            		new RemoveCallbackMethodUndoableEdit(callbackType, methods));
         }		
 	}
 



Mime
View raw message