Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 675eda752632a726fbb502cc2d37d4e00e349a45 (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
/*
 * Copyright (c) 2007, 2008 Borland Software Corporation
 * 
 * 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:
 *    Alexander Shatalin (Borland) - initial API and implementation
 */
 
«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
«EXTENSION xpt::GenModelUtils»

«DEFINE childContainerCreateCommand FOR Sequence(gmfgen::GenNode)-»
«IF not self->isEmpty()-»

	«EXPAND xpt::Common::generatedMemberComment»
	protected org.eclipse.gef.commands.Command getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest req) {
«FOREACH self AS n-»
		«EXPAND childNodeCreateCommand(n) FOR n.modelFacet-»
«ENDFOREACH-»
		return super.getCreateCommand(req);
	}
«ENDIF-»
«ENDDEFINE»

«DEFINE childNodeCreateCommand(node : gmfgen::GenNode) FOR gmfgen::TypeModelFacet-»
if («EXPAND xpt::providers::ElementTypes::accessElementType FOR node» == req.getElementType()) {
	return getGEFWrapper(new «node.getCreateCommandQualifiedClassName()»(req));
}
«ENDDEFINE»

Back to the top