Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e1bc9cc03a81923ea22500f85477f025b87f89db (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
/*******************************************************************************
 * Copyright (c) 2006-2020 Borland Software Corporation, CEA LIST, Artal and others
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/ 
 * 
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors: 
 *    Dmitry Stadnik (Borland) - initial API and implementation
 * 	  Michael Golubev (Montages) - #386838 - migrate to Xtend2
 *    Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
 *****************************************************************************/
package xpt.diagram.edithelpers;

import com.google.inject.Inject
import org.eclipse.papyrus.gmf.codegen.gmfgen.MetamodelType
import xpt.Common

public class EditHelper {
	@Inject extension Common;
	@Inject BaseEditHelper xptBaseEditHelper;

	def className(MetamodelType it) '''«it.editHelperClassName»'''
	
	def packageName(MetamodelType it) '''«it.diagramElement.getDiagram().editHelpersPackageName»'''

	def qualifiedClassName(MetamodelType it) '''«packageName(it)».«className(it)»'''

	def fullPath(MetamodelType it) '''«qualifiedClassName(it)»'''

	def EditHelper(MetamodelType it) '''
		«copyright(diagramElement.diagram.editorGen)»
		package «packageName(it)»;
		
		«generatedClassComment»
		public class «className(it)» extends «xptBaseEditHelper.qualifiedClassName(it.diagramElement.diagram)» {
		«additions(it)»
		}
	'''

	def additions(MetamodelType it) ''''''
}

Back to the top