IEclipseContext context = partContext == null ? parentContext : partContext;
// Allow closes to be 'canceled'
EPartService partService = (EPartService) context
.get(EPartService.class.getName());
if (partService.savePart(part, true)) {
partService.hidePart(part);
return true;
}
// the user has canceled out of the save operation, so don't close the
// part
return false;