Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-03-02 14:11:16 -0500
committeratikhomirov2010-03-02 14:11:16 -0500
commit57dac53923648285bb9e24c079567b1bd597c3a1 (patch)
tree3860c4020347effdc7ce95bff0e632be40cc388f
parent40c447a0c7e23eeaf8b1430bed5f812bfe623797 (diff)
downloadorg.eclipse.gmf-tooling-57dac53923648285bb9e24c079567b1bd597c3a1.tar.gz
org.eclipse.gmf-tooling-57dac53923648285bb9e24c079567b1bd597c3a1.tar.xz
org.eclipse.gmf-tooling-57dac53923648285bb9e24c079567b1bd597c3a1.zip
[304399] Respect implicit EObject supertype for any EMF object.
ChildLabelNodes excluded from Navigator diagram structure calculation in favour of GenLinkEnd support provided by GenLinks now.
-rw-r--r--plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenLinkImpl.java6
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenNodeImpl.java7
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/Extras.java30
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java8
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates-dynmodel/Facility.xpt4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.qvto6
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/LinkUtils.qvto5
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.qvto42
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt10
11 files changed, 80 insertions, 42 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF b/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
index 52280bb19..ca2bfb560 100644
--- a/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.gmf.codegen/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Export-Package: org.eclipse.gmf.codegen.gmfgen,
org.eclipse.gmf.codegen.gmfgen.impl;x-friends:="org.eclipse.gmf.codegen.lite",
org.eclipse.gmf.codegen.gmfgen.util,
org.eclipse.gmf.codegen.util,
- org.eclipse.gmf.internal.codegen.util;x-friends:="org.eclipse.gmf.bridge.ui,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.tests"
+ org.eclipse.gmf.internal.codegen.util;x-friends:="org.eclipse.gmf.bridge.ui,org.eclipse.gmf.codegen.ui,org.eclipse.gmf.tests,org.eclipse.gmf.bridge"
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenLinkImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenLinkImpl.java
index bc784ea15..82d552bf0 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenLinkImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenLinkImpl.java
@@ -36,6 +36,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenNode;
import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
+import org.eclipse.gmf.internal.codegen.util.Extras;
/**
* <!-- begin-user-doc -->
@@ -620,7 +621,7 @@ public class GenLinkImpl extends GenCommonBaseImpl implements GenLink {
}
GenClass actualMetaclass = actualModelFacet.getMetaClass();
- return actualMetaclass != null && desiredEndType.getEcoreClass().isSuperTypeOf(actualMetaclass.getEcoreClass());
+ return actualMetaclass != null && Extras.isSuperTypeOf(desiredEndType.getEcoreClass(), actualMetaclass.getEcoreClass());
}
/**
@@ -689,8 +690,7 @@ public class GenLinkImpl extends GenCommonBaseImpl implements GenLink {
GenClass nodeType = node.getModelFacet().getMetaClass();
if (nodeType != null && nodeType.getEcoreClass() != null) {
for (GenClass participantType : participantTypes) {
- if (participantType.getEcoreClass() != null
- && participantType.getEcoreClass().isSuperTypeOf(nodeType.getEcoreClass())) {
+ if (participantType.getEcoreClass() != null && Extras.isSuperTypeOf(participantType.getEcoreClass(), nodeType.getEcoreClass())) {
participants.add(node);
}
}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenNodeImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenNodeImpl.java
index 6a167b602..7c5a92159 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenNodeImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenNodeImpl.java
@@ -33,6 +33,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenNode;
import org.eclipse.gmf.codegen.gmfgen.GenNodeLabel;
import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
+import org.eclipse.gmf.internal.codegen.util.Extras;
/**
* <!-- begin-user-doc -->
@@ -619,10 +620,10 @@ public abstract class GenNodeImpl extends GenChildContainerImpl implements GenNo
continue;
}
GenClass nodeMetaClass = getModelFacet().getMetaClass();
- boolean canBeSource = outgoingClass.getEcoreClass().isSuperTypeOf(nodeMetaClass.getEcoreClass());
- boolean canBeTarget = incomingClass.getEcoreClass().isSuperTypeOf(nodeMetaClass.getEcoreClass());
+ boolean canBeSource = Extras.isSuperTypeOf(outgoingClass.getEcoreClass(), nodeMetaClass.getEcoreClass());
+ boolean canBeTarget = Extras.isSuperTypeOf(incomingClass.getEcoreClass(), nodeMetaClass.getEcoreClass());
/*
- * This logic is currently alligned with the logic in NodeItemSemanticEditPolicy.javajet i.e.:
+ * This logic is currently aligned with the logic in NodeItemSemanticEditPolicy.javajet i.e.:
*
* - we do not perform link rotation if this link could be drawn from instance of this EP
* to the instance of this EP.
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/Extras.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/Extras.java
new file mode 100644
index 000000000..f6f04932b
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/Extras.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2010 Artem Tikhomirov 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:
+ * Artem Tikhomirov (independent) - initial API and implementation
+ */
+package org.eclipse.gmf.internal.codegen.util;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * @author artem
+ */
+public class Extras {
+
+ /**
+ * This is a handy way to deal with EMF 2.6 M4 change (see bug #255469) - EObject is implicit
+ * superclass for any EClass, but EMF itself doesn't answer this question when asked on a metamodel level
+ * @return true if the first candidate class is supertype of the second, with respect of implicit EObject supertype of any other EClass.
+ */
+ public static boolean isSuperTypeOf(EClass superclassCandidate, EClass subclassCandidate) {
+ return superclassCandidate.isSuperTypeOf(subclassCandidate) || superclassCandidate == EcorePackage.eINSTANCE.getEObject() || ("EObject".equals(superclassCandidate.getName()) && EcorePackage.eNS_URI.equals(superclassCandidate.getEPackage().getNsURI()));
+ }
+}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java
index 7d3445616..43a1149e1 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/internal/codegen/util/GenModelGraphAnalyzer.java
@@ -1,5 +1,5 @@
-/**
- * Copyright (c) 2006 Borland Software Corp.
+/*
+ * Copyright (c) 2006, 2010 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
@@ -212,7 +212,7 @@ public class GenModelGraphAnalyzer {
potentialLinks.add(nextLink);
} else if (node.getModelFacet() != null) {
GenClass genClass = myIsInLinkDirection ? nextLink.getModelFacet().getSourceType() : nextLink.getModelFacet().getTargetType();
- if (genClass != null && genClass.getEcoreClass().isSuperTypeOf(node.getDomainMetaClass().getEcoreClass())) {
+ if (genClass != null && Extras.isSuperTypeOf(genClass.getEcoreClass(), node.getDomainMetaClass().getEcoreClass())) {
potentialLinks.add(nextLink);
}
}
@@ -234,7 +234,7 @@ public class GenModelGraphAnalyzer {
// connection source/target
continue;
}
- if (genClass.getEcoreClass().isSuperTypeOf(nextNode.getDomainMetaClass().getEcoreClass())) {
+ if (Extras.isSuperTypeOf(genClass.getEcoreClass(), nextNode.getDomainMetaClass().getEcoreClass())) {
potentialNodes.add(nextNode);
}
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates-dynmodel/Facility.xpt b/plugins/org.eclipse.gmf.codegen/templates-dynmodel/Facility.xpt
index bfbc5bdef..8304749c7 100644
--- a/plugins/org.eclipse.gmf.codegen/templates-dynmodel/Facility.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates-dynmodel/Facility.xpt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009 Borland Software Corporation
+ * Copyright (c) 2008, 2010 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
@@ -34,7 +34,7 @@ public class «className» {
«EXPAND getRegistryMethod»
- «EXPAND xpt::Common::generatedMemberComment»
+ «EXPAND xpt::Common::generatedMemberComment»«REM»NOTE, when metaClassName is 'EObject', isSuperTypeOf is unlikely (see bug #255469) ever to return true (it lookes into metamodel, and unless obj's EClass has explicit EObject in its superclasses, the method simply returns false). But unless it's requested, I don't want to complicate this piece of code«ENDREM»
public boolean isInstance(Object obj, String metaClassName) {
org.eclipse.emf.ecore.EClass metaClass = getEClass(metaClassName);
return obj instanceof org.eclipse.emf.ecore.EObject && metaClass.isSuperTypeOf(((org.eclipse.emf.ecore.EObject) obj).eClass());
diff --git a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
index 018538a40..cb0c471b0 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/MetaModel.qvto
@@ -138,7 +138,7 @@ helper unparenthesizedCast(what : String, source : genModel::GenClass, target :
--See cast()
-- MODIFIERS: private
helper needsCast(source : genModel::GenClass, target : genModel::GenClass) : Boolean {
- return (if source = target then false else (if target = null then source <> null and isExternalInterface(source) else source = null or (isExternalInterface(target) or (isExternalInterface(source) or not target.ecoreClass.isSuperTypeOf(source.ecoreClass))) endif) endif)
+ return (if source = target then false else (if target = null then source <> null and isExternalInterface(source) else source = null or (isExternalInterface(target) or (isExternalInterface(source) or not target.isSuperTypeOf(source))) endif) endif)
}
-- MODIFIERS: private
helper genModel::GenClassifier::getEcoreClassifier() : ecore::EClassifier { return null }
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.qvto
index 021cb76fd..6dd0e38aa 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/GenModelUtils.qvto
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2009 Borland Software Corporation
+ * Copyright (c) 2006, 2010 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
@@ -69,6 +69,10 @@ helper isContains(gf : genmodel::GenFeature) : Boolean {
helper isPrimitiveType(gf : genmodel::GenFeature) : Boolean {
return Sequence { 'boolean', 'byte', 'char', 'double', 'float', 'int', 'long', 'short' }->includes(gf.ecoreFeature.eType.instanceClassName)
}
+-- Workaround for EMF 2.5M4 change (bug #255469) - always assume implicit EObject supertype.
+helper GenClass::isSuperTypeOf(subclassCandidate : GenClass) : Boolean {
+ return self.ecoreClass.isSuperTypeOf(subclassCandidate.ecoreClass) or (self.ecoreClass.name = 'EObject' and self.ecoreClass.ePackage.nsURI = 'http://www.eclipse.org/emf/2002/Ecore')
+}
-- MODIFIERS:private
helper isReferenceType(gf : genmodel::GenFeature) : Boolean {
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/LinkUtils.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/LinkUtils.qvto
index 516a6ada3..5b2c5d6d3 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/LinkUtils.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/LinkUtils.qvto
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009 Borland Software Corporation
+ * Copyright (c) 2007, 2010 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
@@ -10,6 +10,7 @@
* Alexander Shatalin (Borland) - initial API and implementation
* Michael Golubev (Borland) - [243151] explicit source/target for links
*/
+import xpt.GenModelUtils;
modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
modeltype genmodel uses "http://www.eclipse.org/emf/2002/GenModel";
@@ -50,5 +51,5 @@ helper gmfgen::FeatureLinkModelFacet::getContainerClass() : genmodel::GenClass {
-- MODIFIERS: private
helper isCompatible(desiredType : genmodel::GenClass, actualClass : genmodel::GenClass) : Boolean {
- return null <> desiredType and desiredType.ecoreClass.isSuperTypeOf(actualClass.ecoreClass)
+ return null <> desiredType and desiredType.isSuperTypeOf(actualClass)
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.qvto
index 9e5c60c51..00e7db1dc 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editpolicies/Utils.qvto
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2009 Borland Software Corporation
+ * Copyright (c) 2007, 2010 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
@@ -13,72 +13,72 @@
import xpt.diagram.editpolicies.LinkUtils;
import xpt.GenModelUtils;
-modeltype genModel uses "http://www.eclipse.org/gmf/2009/GenModel";
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
library Utils;
-helper hasChildrenOrCompartments(node : genModel::GenNode) : Boolean {
+helper hasChildrenOrCompartments(node : gmfgen::GenNode) : Boolean {
return not node.childNodes->isEmpty() or not node.compartments->isEmpty()
}
-helper getContainerVariable(modelFacet : genModel::TypeLinkModelFacet) : String {
+helper getContainerVariable(modelFacet : gmfgen::TypeLinkModelFacet) : String {
return (if null <> modelFacet.sourceMetaFeature then 'container' else 'source' endif)
}
-helper getValidLinkConstraints(diagram : genModel::GenDiagram) : Sequence(genModel::GenLinkConstraints) {
+helper getValidLinkConstraints(diagram : gmfgen::GenDiagram) : Sequence(gmfgen::GenLinkConstraints) {
return diagram.links->select(l | null <> l.creationConstraints and l.creationConstraints.isValid())->collect(l | l.creationConstraints)
}
-helper getAllPotentialLinks(linkEnd : genModel::GenLinkEnd) : Sequence(genModel::GenLink) {
+helper getAllPotentialLinks(linkEnd : gmfgen::GenLinkEnd) : Sequence(gmfgen::GenLink) {
return getAllRelatedLinks(linkEnd)->select(link | isCreationAllowed(link))
}
-helper getReroutableTypeLinks(linkEnd : genModel::GenLinkEnd) : Sequence(genModel::GenLink) {
+helper getReroutableTypeLinks(linkEnd : gmfgen::GenLinkEnd) : Sequence(gmfgen::GenLink) {
return getAllRelatedReroutableLinks(linkEnd)->select(isTypeLink())
}
-helper getReroutableRefLinks(linkEnd : genModel::GenLinkEnd) : Sequence(genModel::GenLink) {
+helper getReroutableRefLinks(linkEnd : gmfgen::GenLinkEnd) : Sequence(gmfgen::GenLink) {
return getAllRelatedReroutableLinks(linkEnd)->select(isRefLink())
}
--XXX[MG]: again, it would be better to use linkEnd.incomingLinks.union(linkEnd.outgoingLinks).toList()
--but it will change the ordering and produce meaningless diff in the generated code
-- MODIFIERS: private cached
-helper getAllRelatedLinks(linkEnd : genModel::GenLinkEnd) : Sequence(genModel::GenLink) {
+helper getAllRelatedLinks(linkEnd : gmfgen::GenLinkEnd) : Sequence(gmfgen::GenLink) {
return linkEnd.getDiagram().links->select(link | canBeSource(link, linkEnd) or canBeTarget(link, linkEnd))->asSequence()
}
-- MODIFIERS: private cached
-helper getAllRelatedReroutableLinks(linkEnd : genModel::GenLinkEnd) : Sequence(genModel::GenLink) {
+helper getAllRelatedReroutableLinks(linkEnd : gmfgen::GenLinkEnd) : Sequence(gmfgen::GenLink) {
return linkEnd.getDiagram().links->select(link | canBeSource(link, linkEnd) and link.sourceReorientingAllowed or (canBeTarget(link, linkEnd) and link.targetReorientingAllowed))->asSequence()
}
-- MODIFIERS: private
-helper isCreationAllowed(link : genModel::GenLink) : Boolean {
+helper isCreationAllowed(link : gmfgen::GenLink) : Boolean {
return null <> link.modelFacet and (link.outgoingCreationAllowed or link.incomingCreationAllowed)
}
-helper createStartLinkCommand(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper createStartLinkCommand(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return createStartOutgoingLinkCommand(link, linkEnd) or createStartIncomingLinkCommand(link, linkEnd)
}
-helper createStartOutgoingLinkCommand(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper createStartOutgoingLinkCommand(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return isSelf(link, linkEnd) or (isOutgoing(link, linkEnd) and link.outgoingCreationAllowed)
}
-helper createStartIncomingLinkCommand(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper createStartIncomingLinkCommand(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return isIncoming(link, linkEnd) and link.incomingCreationAllowed
}
-helper createCompleteLinkCommand(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper createCompleteLinkCommand(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return createCompleteIncomingLinkCommand(link, linkEnd) or createCompleteOutgoingLinkCommand(link, linkEnd)
}
-helper createCompleteIncomingLinkCommand(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper createCompleteIncomingLinkCommand(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return isSelf(link, linkEnd) or (isIncoming(link, linkEnd) and link.outgoingCreationAllowed)
}
-helper createCompleteOutgoingLinkCommand(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper createCompleteOutgoingLinkCommand(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return isOutgoing(link, linkEnd) and link.incomingCreationAllowed
}
@@ -91,17 +91,17 @@ helper checkTarget(reversedRequest : Boolean, isCompleteCommand : Boolean) : Boo
}
-- MODIFIERS: private
-helper isSelf(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper isSelf(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return canBeSource(link, linkEnd) and canBeTarget(link, linkEnd)
}
-- MODIFIERS: private
-helper isOutgoing(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper isOutgoing(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return canBeSource(link, linkEnd) and not canBeTarget(link, linkEnd)
}
-- MODIFIERS: private
-helper isIncoming(link : genModel::GenLink, linkEnd : genModel::GenLinkEnd) : Boolean {
+helper isIncoming(link : gmfgen::GenLink, linkEnd : gmfgen::GenLinkEnd) : Boolean {
return canBeTarget(link, linkEnd) and not canBeSource(link, linkEnd)
}
@@ -111,5 +111,5 @@ helper i18nKeyForOpenCommandName() : String {
-- if child's containment feature comes from the node, assume deletion of the parent would delete the child.
helper GenChildNode::isDirectlyOwned(genNode : GenNode) : Boolean {
if self.modelFacet.oclIsUndefined() or genNode.modelFacet.oclIsUndefined() then return false endif; -- can't assume anything
- return self.modelFacet.containmentMetaFeature.ecoreFeature.eContainingClass.isSuperTypeOf(genNode.modelFacet.metaClass.ecoreClass)
+ return self.modelFacet.containmentMetaFeature.genClass.isSuperTypeOf(genNode.modelFacet.metaClass)
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt
index 40db5a298..eaed6f8d4 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/navigator/NavigatorContentProvider.xpt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2009 Borland Software Corporation
+ * Copyright (c) 2006, 2010 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
@@ -418,10 +418,11 @@ private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notatio
«EXPAND addForeignShortcuts FOR self-»
«LET getChildReferencesFrom(navigator, self) AS _references-»
«EXPAND initGroupVariables(navigator, _references, 'parentElement', self) FOREACH getGroupNames(_references)-»
- «FOREACH _references AS reference ITERATOR referencesIterator-»
- «FOREACH reference.findConnectionPaths()->asSequence() AS path ITERATOR pathsIterator-»
+ «IF _references->notEmpty() and _references->findConnectionPaths()->notEmpty()-»
+ java.util.Collection connectedViews;
+ «FOREACH _references AS reference-»
+ «FOREACH reference.findConnectionPaths() AS path-»
«FOREACH path.segments->asSequence() AS segment ITERATOR segmentsIterator-»
- «IF referencesIterator.isFirstIteration() and (pathsIterator.isFirstIteration() and segmentsIterator.isFirstIteration())»java.util.Collection «ENDIF-»
connectedViews = «EXPAND childrenMethodName(reference.referenceType, segment) FOR segment._from-»
(«IF segmentsIterator.isFirstIteration()»java.util.Collections.singleton(view)«ELSE»connectedViews«ENDIF-»
, «EXPAND xpt::editor::VisualIDRegistry::typeMethodCall FOR segment.to»);
@@ -429,6 +430,7 @@ private java.util.Collection getForeignShortcuts(org.eclipse.gmf.runtime.notatio
«EXPAND addNavigatorItemsPrefix FOR reference»connectedViews«EXPAND addNavigatorItemsSuffix('parentElement', reference.referenceType <> gmfgen::GenNavigatorReferenceType::children) FOR reference-»
«ENDFOREACH-»
«ENDFOREACH-»
+ «ENDIF-»
«EXPAND addGroups(_references) FOREACH getGroupNames(_references)-»
«ENDLET-»
return result.toArray();

Back to the top