blob: 60c2db4de22a665b085e9f6f420f19d09e617896 (
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
|
/*******************************************************************************
* Copyright (c) 2011 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.logical.adapter;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.emf.compare.logical.model.EMFModelProvider;
import org.eclipse.emf.compare.logical.synchronization.EMFCompareAdapter;
import org.eclipse.team.ui.mapping.ISynchronizationCompareAdapter;
/**
* This will be used to adapt EMF types to various parts of the logical model framework.
*
* @author <a href="mailto:laurent.goubet@obeo.fr">laurent Goubet</a>
*/
public class EMFAdapterFactory implements IAdapterFactory {
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
@SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) {
Object adapter = null;
if (adaptableObject instanceof EMFModelProvider) {
if (adapterType == ISynchronizationCompareAdapter.class) {
adapter = new EMFCompareAdapter(EMFModelProvider.PROVIDER_ID);
}
}
return adapter;
}
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
@SuppressWarnings("rawtypes")
public Class[] getAdapterList() {
return new Class[] {ISynchronizationCompareAdapter.class,};
}
}
|