Skip to content

Commit

Permalink
TEIIDDES-1929: Stricter policy on allowing deletions with open editors
Browse files Browse the repository at this point in the history
* When deleting, resources are unloaded and closed. This can lead to odd
  updates to open editors

* Delete is the only refactoring to allow the operation whilst editors are
  open. This is fine if an editor for the resource being deleted is open
  since the editor gets closed anyway. However, it can be a problem for
  related resource editors, especially if the delete is cancelled. The
  resources are not reloaded and the editor never refreshed

* Check for open editors of related resources and just get the user to
  close it first before proceeding.
  • Loading branch information
Paul Richardson committed Dec 2, 2013
1 parent 61b95c9 commit 545cc47
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ protected void checkResource(IResource resource, IProgressMonitor progressMonito
if (status.getSeverity() > IStatus.WARNING) return;

RefactorResourcesUtils.checkSavedResource(resource, status);
if (status.getSeverity() > IStatus.WARNING) return;

if (! getResources().contains(resource)) {
/*
* Its okay to delete a resource if an editor for it is open but can cause
* problems for related resources, especially if the user previews then
* cancels the delete operation.
*/
RefactorResourcesUtils.checkOpenEditors(resource, status);
}
}

@Override
Expand Down

0 comments on commit 545cc47

Please sign in to comment.