Skip to main content
summaryrefslogtreecommitdiffstats
blob: b1a923c63c5888c57a1e1bd0fb1ef04b7fb0df5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*******************************************************************************
 * Copyright (c) 2016 Obeo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Obeo - initial API and implementation
 *******************************************************************************/
package org.eclipse.emf.compare.match;

import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;

/**
 * Specific {@link Adapter} to {@link Match}es that are related to containment {@link ReferenceChange}s (that
 * are placed in their parent {@link Match}).
 * 
 * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
 */
public class MatchOfContainmentReferenceChangeAdapter extends AdapterImpl {

	/** The {@link ReferenceChange} to associate with the adapted {@link Match}. */
	private ReferenceChange referenceChange;

	/**
	 * Constructor.
	 * 
	 * @param referenceChange
	 *            The {@link ReferenceChange} to associate with the adapted {@link Match}.
	 */
	public MatchOfContainmentReferenceChangeAdapter(ReferenceChange referenceChange) {
		super();
		this.referenceChange = referenceChange;
	}

	/**
	 * {@inheritDoc} .
	 * 
	 * @see org.eclipse.emf.common.notify.impl.AdapterImpl#isAdapterForType(Object)
	 */
	@Override
	public boolean isAdapterForType(Object type) {
		if (type == MatchOfContainmentReferenceChangeAdapter.class) {
			return true;
		}
		return super.isAdapterForType(type);
	}

	/**
	 * Get the {@link ReferenceChange} to associate with the adapted {@link Match}.
	 * 
	 * @return The {@link ReferenceChange} to associate with the adapted {@link Match}.
	 */
	public ReferenceChange getReferenceChange() {
		return referenceChange;
	}
}

Back to the top