Skip to content
Snippets Groups Projects
Commit 407ef987 authored by Georgetta Igna's avatar Georgetta Igna
Browse files

Yellow;

disabled Delete when trying to delete the background of the editor.
refs 2202
parent 3debe4e3
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService; ...@@ -52,7 +52,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
* @author hoelzl * @author hoelzl
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 77B414F02AC48706566ABE2730A3AABB * @ConQAT.Rating YELLOW Hash: 321312CCB8B9B8E9973A26EEB4C895EF
*/ */
public class DeleteAction extends EObjectActionBase<EObject> { public class DeleteAction extends EObjectActionBase<EObject> {
...@@ -110,6 +110,15 @@ public class DeleteAction extends EObjectActionBase<EObject> { ...@@ -110,6 +110,15 @@ public class DeleteAction extends EObjectActionBase<EObject> {
/** Compute if one given target can be deleted. */ /** Compute if one given target can be deleted. */
private boolean canDelete(EObject target) { private boolean canDelete(EObject target) {
IWorkbenchPart activePart =
getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
if(activePart instanceof ExtendableMultiPageEditor) {
EObject editedObject = ((ExtendableMultiPageEditor)activePart).getEditedObject();
if(editedObject.equals(target))
return false;
}
if(!IPersistencyService.INSTANCE.isTopLevelElement(target)) { if(!IPersistencyService.INSTANCE.isTopLevelElement(target)) {
// use composition services for deletion // use composition services for deletion
return(IElementCompositorService.INSTANCE.canDecompose(target) || IConnectionCompositorService.INSTANCE return(IElementCompositorService.INSTANCE.canDecompose(target) || IConnectionCompositorService.INSTANCE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment