### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.runtime.emf.type.core Index: src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.emf.type.core/src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java,v retrieving revision 1.17 diff -u -r1.17 AbstractEditHelper.java --- src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java 3 Oct 2006 15:06:38 -0000 1.17 +++ src/org/eclipse/gmf/runtime/emf/type/core/edithelper/AbstractEditHelper.java 13 Nov 2007 21:11:57 -0000 @@ -135,7 +135,11 @@ return null; } - return getEditCommand(req, advice); + ICommand result = getEditCommand(req, advice); + if (result != null) { + return result.reduce(); + } + return result; } /** @@ -732,8 +736,6 @@ */ protected ICommand getDestroyElementCommand(DestroyElementRequest req) { ICommand result = null; - - ICommand destroyParent = getDestroyElementWithDependentsCommand(req); EObject parent = req.getElementToDestroy(); @@ -747,8 +749,13 @@ .get(RequestCacheEntries.Checked_Elements); checkedElement.add(parent); Map parentMap = (Map) cacheMaps.get(parent); - parentType = (IElementType) parentMap - .get(RequestCacheEntries.Element_Type); + if (parentMap != null) { + parentType = (IElementType) parentMap + .get(RequestCacheEntries.Element_Type); + } else { + parentType = ElementTypeRegistry.getInstance().getElementType( + parent); + } } else { parentType = ElementTypeRegistry.getInstance().getElementType( parent); @@ -776,15 +783,23 @@ result = result.compose(command); } - if (!command.canExecute()) { - // no point in continuing if we're abandoning the works - break; - } +// Under normal circumstances the command is executable. +// Checking canExecute here slows down large scenarios and it is therefore +// better to skip this check. +// if (!command.canExecute()) { +// // no point in continuing if we're abandoning the works +// break; +// } } } } } + // restore the elementToDestroy in the original request + req.setElementToDestroy(parent); + + ICommand destroyParent = getDestroyElementWithDependentsCommand(req); + //bottom-up destruction: destroy children before parent if (result == null) { result = destroyParent; @@ -792,9 +807,6 @@ result = result.compose(destroyParent); } - // restore the elementToDestroy in the original request - req.setElementToDestroy(parent); - return result; }