Adds onDispose method on the resource set hooks.
[EMFCompare2.git] / plugins / org.eclipse.emf.compare.ide / src / org / eclipse / emf / compare / ide / internal / utils / UnloadingResourceSetHook.java
blobfe95f17de9e95bfff3fb684565ef675e5909f02e
1 /*******************************************************************************
2 * Copyright (c) 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.emf.compare.ide.internal.utils;
13 import org.eclipse.emf.compare.ide.hook.AbstractResourceSetHooks;
14 import org.eclipse.emf.ecore.resource.Resource;
16 /**
17 * Hook that unloads resources from the resource set on dipose.
19 * @author <a href="mailto:arthur.daussy@obeo.fr">Arthur Daussy</a>
21 public class UnloadingResourceSetHook extends AbstractResourceSetHooks {
23 /**
24 * {@inheritDoc}
26 * @see org.eclipse.emf.compare.ide.hook.AbstractResourceSetHooks#onDispose(java.lang.Iterable)
28 @Override
29 public void onDispose(Iterable<Resource> resources) {
30 for (Resource resource : resources) {
31 if (resource.isLoaded()) {
32 resource.unload();