{
        IResourceDelta delta = event.getDelta();
        try
        {
          class ResourceDeltaVisitor implements IResourceDeltaVisitor
          {
            protected ResourceSet resourceSet = editingDomain.getResourceSet();
            protected Collection<Resource> changedResources = new ArrayList<Resource>();
            protected Collection<Resource> removedResources = new ArrayList<Resource>();

            public boolean visit(IResourceDelta delta)
            {
              if (delta.getResource().getType() == IResource.FILE)
              {
                if (delta.getKind() == IResourceDelta.REMOVED ||
                    delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS)
                {
                  Resource resource = resourceSet.getResource(URI.createURI(delta.getFullPath().toString()), false);
                  if (resource != null)
                  {
                    if (delta.getKind() == IResourceDelta.REMOVED)
                    {
                      removedResources.add(resource);
                    }
                    else if (!savedResources.remove(resource))
                    {
                      changedResources.add(resource);
                    }
                  }
                }
              }

              return true;
            }

            public Collection<Resource> getChangedResources()
            {
              return changedResources;
            }

            public Collection<Resource> getRemovedResources()
            {
              return removedResources;
            }
          }

          ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
          delta.accept(visitor);

          if (!visitor.getRemovedResources().isEmpty())
          {
            removedResources.addAll(visitor.getRemovedResources());
            if (!isDirty())
            {
              getSite().getShell().getDisplay().asyncExec
                (new Runnable()
                 {
                   public void run()
                   {
                     getSite().getPage().closeEditor(EcoreEditor.this, false);
                   }
                 });
            }
          }

          if (!visitor.getChangedResources().isEmpty())
          {
            changedResources.addAll(visitor.getChangedResources());
            if (getSite().getPage().getActiveEditor() == EcoreEditor.this)
            {
              getSite().getShell().getDisplay().asyncExec
                (new Runnable()
                 {
                   public void run()
                   {
                     handleActivate();
                   }
                 });
            }
          }
        }
        catch (CoreException exception)
        {
          EcoreEditorPlugin.INSTANCE.log(exception);
        }
      }