Community
Participate
Working Groups
The current implementation of EMFCoreUtil.destroy() recursively destroys contained elements. However, there can be other elements that have an existence dependency on the element being destroyed but are not contained. It should be possible for a metamodel provider or a client application to indicate which other dependents should also be destroyed.
Created attachment 35805 [details] New extensible DestroyElementCommand and related changes The attached patch makes the following changes: - re-implement DestroyElementCommand to 1. recursively destroy contained objects (bottom-up) 2. find the non-contained dependents of the element that also need to be destroyed and destroy them (using a new DestroyDependentsRequest) 3. destroy the element - sweep GMF run-time to replace calls to EMFCoreUtil.destroy(EObject) (which does not work) with a new DestroyElementCommand.destroy(EObject) utility method - sweep GMF run-time to replace DESTROY semantic procedures with advice on the DestroyDependentsRequest. This included: - NotationSemProc (for view-related semantic procedures) - added a TerminalEditHelper to the Logic Example to destroy the wires attached to a terminal when a terminal is destroyed (this was missing behaviour; deleting gates would leave invisible wires in the semantic model) - re-implement EObjectUtil.destroy(EObject) in the compatibility layer to use the DestroyElementCommand - for compatibility purposes, added advice to fire PRE_DESTROY and DESTROY events (MSL specials) before and after object destruction, respectively - added support for wildcard advice (advice on all element types) to the EMF Type API, together with a default metamodel type that matches elements having no other type registered for them (required to support the notation view destruction)
Patch committed by Linda.
Created attachment 36027 [details] Follow-up for destruction of root objects This is a follow-up patch to support destruction of resource roots (with two new unit tests). The DestroyElementRequest now returns the default metamodel type as the edit context for objects that have no container but are attached to a resource (i.e., resource roots). Detached elements cannot be destroyed.
Forgot to mention that the second patch was applied and is included in the 20060310 integration build.
[target cleanup] 1.0 M6 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Runtime EMF was the original product and component for this bug