Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 58a5807bc5e30ea82a248fe77a7ce9fbbe23e312 (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
/**
 * Copyright (c) 2006-2013 Borland Software Corporation and others
 * 
 * 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:
 *    Dmitry Stadnik (Borland) - initial API and implementation
 *    Michael Golubev (Montages) - #386838 - migrate to Xtend2
 */
package aspects.xpt;

import com.google.inject.Singleton
import org.eclipse.gmf.codegen.gmfgen.GenCommonBase
import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator
import org.eclipse.papyrus.papyrusgmfgenextension.VisualIDOverride

@Singleton class Common extends xpt.Common {
	override copyright(GenEditorGenerator it) 
	'''
	«IF copyrightText != null»
	/**
	 * «copyrightText.replaceAll('\n', '\n * ')»
	 */
 	«ENDIF»
	'''

	def String stringVisualID(GenCommonBase it) {
		if (it.eResource.allContents.filter(typeof (VisualIDOverride)).exists(v|v.genView == it))
			it.eResource.allContents.filter(typeof (VisualIDOverride)).findFirst(v|v.genView == it).visualID
		else
			it.visualID.toString
	}

	def String stringUniqueIdentifier(GenCommonBase it) {
		if (it.eResource.allContents.filter(typeof (VisualIDOverride)).exists(v|v.genView == it))
			it.eResource.allContents.filter(typeof (VisualIDOverride)).findFirst(v|v.genView == it).visualID
		else
			it.uniqueIdentifier
	}
}

Back to the top