}
public void run() throws Exception {
removeTemporaryLayers(store);
Project p = getMap().getProjectInternal();
if (p != null) {
if (p.eResource() != null && p.eResource().isModified()) {
p.eResource().save(ProjectPlugin.getPlugin().saveOptions);
}
/*
* when closing a map the platform wants to save the map resource,
* but if you are removing the map, its no longer available.
*/
final Map map = getMap();
final Resource resource = map.eResource();
if (resource != null)
resource.save(ProjectPlugin.getPlugin().saveOptions);
// need to kick the Project so viewers will update
p.eNotify(new ENotificationImpl((InternalEObject) p, Notification.SET,
ProjectPackage.PROJECT__ELEMENTS_INTERNAL, null, null));
} else {
final Resource resource = getMap().eResource();
if (resource != null)