View | Details | Raw Unified | Return to bug 152706 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/diagram/ui/internal/actions/DeleteFromModelAction.java (-5 / +7 lines)
Lines 82-90 Link Here
82
			if (editPart instanceof IGraphicalEditPart) {
82
			if (editPart instanceof IGraphicalEditPart) {
83
				IGraphicalEditPart gEditPart = (IGraphicalEditPart) editPart;
83
				IGraphicalEditPart gEditPart = (IGraphicalEditPart) editPart;
84
				View view = (View) gEditPart.getModel();
84
				View view = (View) gEditPart.getModel();
85
				EObject element = ViewUtil.resolveSemanticElement(view);
85
				// Allow diagram deletion from model only if it is the top most diagram
86
				if ((element == null) || (element.eIsProxy())
86
				EObject container = view.eContainer();
87
					|| (element instanceof Diagram)) {
87
				if (view instanceof Diagram && (container == null || !(container instanceof View))) {
88
					return false;
88
					return false;
89
				}
89
				}
90
			} else {
90
			} else {
Lines 133-141 Link Here
133
				IGraphicalEditPart gEditPart = 
133
				IGraphicalEditPart gEditPart = 
134
					(IGraphicalEditPart) editPart;
134
					(IGraphicalEditPart) editPart;
135
				View view = (View)gEditPart.getModel();
135
				View view = (View)gEditPart.getModel();
136
				EObject element = ViewUtil.resolveSemanticElement(view);
136
				// Delete diagram from model only if it is the top most diagram
137
				if(element instanceof Diagram)
137
				EObject container = view.eContainer();
138
				if (view instanceof Diagram && (container == null || !(container instanceof View))) {
138
					return null;
139
					return null;
140
				}
139
			}
141
			}
140
			Command curCommand = editPart.getCommand(request);
142
			Command curCommand = editPart.getCommand(request);
141
			if (curCommand != null) {
143
			if (curCommand != null) {

Return to bug 152706