Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 18d0f9a01cc1cc8c6217ec0324f585a5e3d7b9db (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
50
51
52
53
54
55
/*
 * Copyright (c) 2007 Borland Software Corp.
 * 
 * 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:
 *    bblajer (Borland) - initial API and implementation
 */

import "http://www.eclipse.org/emf/2002/Ecore";
import "http://www.eclipse.org/emf/2002/GenModel";
import "http://www.eclipse.org/gmf/2005/GenModel/2.0";
extension xpt::commands::CommandUtils;

boolean needsNotationModelRefresher(gmfgen::GenContainerBase gcb) :
	gcb.getChildNodesForNotationModelRefresher().size() > 0
;

cached Collection[gmfgen::GenNode] getChildNodesForNotationModelRefresher(gmfgen::GenContainerBase gcb) :
	gcb.getChildNodes().select(e| e.modelFacet != null && e.modelFacet.metaClass != null && e.modelFacet.childMetaFeature != null)
;

Collection[gmfgen::GenNode] getConstraintsInChildren(gmfgen::GenContainerBase gcb) :
	gcb.getChildNodes().select(e| e.modelFacet != null && e.modelFacet.metaClass != null && e.modelFacet.modelElementSelector != null)
;

Collection[genmodel::GenFeature] getChildFeatures(gmfgen::GenContainerBase gcb) :
	//{}.union() provides uniqueness
	{}.union(gcb.getChildNodesForNotationModelRefresher().modelFacet.childMetaFeature)
;

Collection[gmfgen::GenNode] getGenNodes(gmfgen::GenContainerBase genContainerBase, genmodel::GenFeature genFeature) :
JAVA org.eclipse.gmf.internal.codegen.lite.utils.SemanticSyncUtils.getGenNodes(org.eclipse.gmf.codegen.gmfgen.GenContainerBase, org.eclipse.emf.codegen.ecore.genmodel.GenFeature)
;

cached Collection[gmfgen::GenContainerBase] getAllInitableContainers(gmfgen::GenDiagram diagram) :
	diagram.getAllContainersWithChildren().union(diagram.getAllNodes().select(e|e.getInitableCompartments().size() > 0))
;

private Collection[gmfgen::GenContainerBase] getAllContainersWithChildren(gmfgen::GenDiagram diagram) :
	diagram.getAllContainers().select(e| e.needsNotationModelRefresher())
;

cached Collection[gmfgen::GenCompartment] getInitableCompartments(gmfgen::GenNode node) :
	node.compartments.select(e| e.needsNotationModelRefresher())
;

Collection[gmfgen::GenContainerBase] getInitableGrandChildren(gmfgen::GenContainerBase gcb) :
	let allInitableContainers = getAllInitableContainers(gcb.getDiagram()) :
		gcb.getChildNodesForNotationModelRefresher().select(e| allInitableContainers.contains(e))
;

Back to the top