Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ff4a5b4967345c28dec5e8066b84400bbc3e3e9b (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) 2010 CEA LIST.
 *    
 * 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:
 *  Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.infra.xtext.widgets.adapter;

import org.eclipse.emf.ecore.EObject;

import com.google.inject.Injector;


public interface IXtextAdapter {

	/**
	 * In some cases, the Xtext object is different from the model object
	 * This method is called when the modifications on the Xtext model are
	 * validated
	 * 
	 * @param xtextObject
	 *        The EObject generated by the compilation of the Xtext model
	 * @param sourceModelObject
	 *        The current value for the reference being edited
	 * @return the Model object
	 *         The new value for the reference being edited
	 */
	public EObject reconcile(EObject sourceModelObject, EObject xtextObject);

	/**
	 * Returns the Xtext String representing the given EObject
	 * 
	 * @param modelObject
	 *        The EObject being edited. May be null if the reference is unset.
	 * @return
	 *         The Xtext String representing the given EObject
	 */
	public String getText(EObject modelObject);

	/**
	 * @return the Injector to initialize the Xtext editor
	 */
	public Injector getInjector();
}

Back to the top