Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2006-04-20 20:36:48 +0000
committerashatalin2006-04-20 20:36:48 +0000
commit9e59d27423a97898afb8ac60325cf2012cf06999 (patch)
tree07567fd80b5af7766cbfef6a8968bb47bfc2c049 /plugins/org.eclipse.gmf.codegen/templates
parentfdc6327debc9f35642c3c7103d4c56039a5318e2 (diff)
downloadorg.eclipse.gmf-tooling-9e59d27423a97898afb8ac60325cf2012cf06999.tar.gz
org.eclipse.gmf-tooling-9e59d27423a97898afb8ac60325cf2012cf06999.tar.xz
org.eclipse.gmf-tooling-9e59d27423a97898afb8ac60325cf2012cf06999.zip
#125900 Redundant annotations added to View in generated view factory
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/VisualIDRegistry.javajet57
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/DiagramEditPart.javajet4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/EditPartFactory.javajet8
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/ExternalNodeLabelEditPart.javajet2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/LinkLabelEditPart.javajet4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/NodeEditPart.javajet4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/visualID.jetinc2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/providers/MetricProvider.javajet2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/providers/ParserProvider.javajet2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/providers/ViewFactory.javajet8
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/providers/ViewProvider.javajet8
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/initDiagramContents.jetinc6
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticDiagram.jetinc2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/storeLinks.jetinc8
18 files changed, 72 insertions, 55 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
index 182397a92..0f5ded03d 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
@@ -123,7 +123,7 @@ public class <%=genDiagram.getNewDiagramFileWizardClassName()%> extends Wizard {
AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, "Initializing diagram contents", affectedFiles) { //$NON-NLS-1$
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
int diagramVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getDiagramVisualID(diagramModelObject);
- if (diagramVID != <%=genDiagram.getVisualID()%>) {
+ if (diagramVID != <%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.VISUAL_ID) {
return CommandResult.newErrorCommandResult("Incorrect model object stored as a root resource object"); //$NON-NLS-1$
}
Diagram diagram = ViewService.createDiagram(diagramModelObject, <%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.MODEL_ID, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/VisualIDRegistry.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/VisualIDRegistry.javajet
index 7cadd0778..2721f623f 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/VisualIDRegistry.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/VisualIDRegistry.javajet
@@ -39,17 +39,12 @@ public class <%=genDiagram.getVisualIDRegistryClassName()%> {
public static int getVisualID(View view) {
if (view instanceof Diagram) {
if (<%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.MODEL_ID.equals(view.getType())) {
- return <%=genDiagram.getVisualID()%>;
+ return <%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.VISUAL_ID;
} else {
return -1;
}
}
- try {
- return Integer.parseInt(view.getType());
- } catch (NumberFormatException e) {
- <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().logInfo("Unable to parse view type as a visualID number: " + view.getType());
- }
- return -1;
+ return getVisualID(view.getType());
}
/**
@@ -66,7 +61,26 @@ public class <%=genDiagram.getVisualIDRegistryClassName()%> {
}
return diagram != null ? diagram.getType() : null;
}
-
+
+ /**
+ * @generated
+ */
+ public static int getVisualID(String type) {
+ try {
+ return Integer.parseInt(type);
+ } catch (NumberFormatException e) {
+ <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().logInfo("Unable to parse view type as a visualID number: " + type);
+ }
+ return -1;
+ }
+
+ /**
+ * @generated
+ */
+ public static String getType(int visualID) {
+ return String.valueOf(visualID);
+ }
+
/**
* @generated
*/
@@ -88,7 +102,7 @@ if (genDiagram.getDomainDiagramElement() != null) {
String interfaceName = importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName());
%>
if (<%=genDiagram.getMetaPackageName(importManager)%>.eINSTANCE.get<%=classifierAccessorName%>().equals(domainElementMetaclass) && (domainElement == null || isDiagram<%=genDiagram.getUniqueIdentifier()%>((<%=interfaceName%>) domainElement))) {
- return <%=genDiagram.getVisualID()%>;
+ return <%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.VISUAL_ID;
}
<%}%>
return getUnrecognizedDiagramID(domainElement);
@@ -130,33 +144,34 @@ for (Iterator it = genDiagram.getShortcutsProvidedFor().iterator(); it.hasNext()
containerVisualID = getVisualID(containerView);
} else {
if (containerView instanceof Diagram) {
- containerVisualID = <%=genDiagram.getVisualID()%>;
+ containerVisualID = <%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.VISUAL_ID;
} else {
return -1;
}
}
+ int nodeVisualID = getVisualID(semanticHint);
switch (containerVisualID) {
<%
for (Iterator containers = allContainers.iterator(); containers.hasNext();) {
GenContainerBase nextContainer = (GenContainerBase) containers.next();
%>
- case <%=nextContainer.getVisualID()%>:
+ case <%=importManager.getImportedName(nextContainer.getEditPartQualifiedClassName())%>.VISUAL_ID:
<%
if (nextContainer instanceof GenNode) {
GenNode node = (GenNode) nextContainer;
for (Iterator labels = node.getLabels().iterator(); labels.hasNext() && !node.isListContainerEntry();) {
GenNodeLabel label = (GenNodeLabel) labels.next();
%>
- if (<%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID.equals(semanticHint)) {
- return <%=label.getVisualID()%>;
+ if (<%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID == nodeVisualID) {
+ return <%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID;
}
<%
}
for (Iterator compartments = node.getCompartments().iterator(); compartments.hasNext();) {
GenCompartment compartment = (GenCompartment) compartments.next();
%>
- if (<%=importManager.getImportedName(compartment.getEditPartQualifiedClassName())%>.VISUAL_ID.equals(semanticHint)) {
- return <%=compartment.getVisualID()%>;
+ if (<%=importManager.getImportedName(compartment.getEditPartQualifiedClassName())%>.VISUAL_ID == nodeVisualID) {
+ return <%=importManager.getImportedName(compartment.getEditPartQualifiedClassName())%>.VISUAL_ID;
}
<%
}
@@ -168,8 +183,8 @@ for (Iterator containers = allContainers.iterator(); containers.hasNext();) {
final String interfaceName = importManager.getImportedName(childNode.getDomainMetaClass().getQualifiedInterfaceName());
final String semanticPackageInterfaceName = importManager.getImportedName(childNode.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName());
%>
- if ((semanticHint == null || <%=importManager.getImportedName(childNode.getEditPartQualifiedClassName())%>.VISUAL_ID.equals(semanticHint)) && <%=semanticPackageInterfaceName%>.eINSTANCE.get<%=classifierAccessorName%>().equals(domainElementMetaclass) && (domainElement == null || isNode<%=childNode.getUniqueIdentifier()%>((<%=interfaceName%>) domainElement))) {
- return <%=childNode.getVisualID()%>;
+ if ((semanticHint == null || <%=importManager.getImportedName(childNode.getEditPartQualifiedClassName())%>.VISUAL_ID == nodeVisualID) && <%=semanticPackageInterfaceName%>.eINSTANCE.get<%=classifierAccessorName%>().equals(domainElementMetaclass) && (domainElement == null || isNode<%=childNode.getUniqueIdentifier()%>((<%=interfaceName%>) domainElement))) {
+ return <%=importManager.getImportedName(childNode.getEditPartQualifiedClassName())%>.VISUAL_ID;
}
<%
}
@@ -180,13 +195,13 @@ for (Iterator containers = allContainers.iterator(); containers.hasNext();) {
for (Iterator links = genLinks.iterator(); links.hasNext();) {
GenLink link = (GenLink) links.next();
%>
- case <%=link.getVisualID()%>:
+ case <%=importManager.getImportedName(link.getEditPartQualifiedClassName())%>.VISUAL_ID:
<%
for (Iterator linkLabels = link.getLabels().iterator(); linkLabels.hasNext();) {
GenLinkLabel linkLabel = (GenLinkLabel) linkLabels.next();
%>
- if (<%=importManager.getImportedName(linkLabel.getEditPartQualifiedClassName())%>.VISUAL_ID.equals(semanticHint)) {
- return <%=linkLabel.getVisualID()%>;
+ if (<%=importManager.getImportedName(linkLabel.getEditPartQualifiedClassName())%>.VISUAL_ID == nodeVisualID) {
+ return <%=importManager.getImportedName(linkLabel.getEditPartQualifiedClassName())%>.VISUAL_ID;
}
<% }%>
return getUnrecognized<%=link.getUniqueIdentifier()%>LinkLabelID(semanticHint);
@@ -217,7 +232,7 @@ for (int i = 0; i < genLinks.size(); i++) {
final String semanticPackageInterfaceName = importManager.getImportedName(modelFacet.getMetaClass().getGenPackage().getQualifiedPackageInterfaceName());
%>
if (<%=semanticPackageInterfaceName%>.eINSTANCE.get<%=semanticLinkInterfaceName%>().equals(domainElementMetaclass) && (domainElement == null || isLinkWithClass<%=genLink.getUniqueIdentifier()%>((<%=importManager.getImportedName(qualifiedInterfaceName)%>) domainElement))) {
- return <%=genLink.getVisualID()%>;
+ return <%=importManager.getImportedName(genLink.getEditPartQualifiedClassName())%>.VISUAL_ID;
} else
<%
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/DiagramEditPart.javajet b/plugins/org.eclipse.gmf.codegen/templates/parts/DiagramEditPart.javajet
index 26ab43012..07126b6cd 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/DiagramEditPart.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/DiagramEditPart.javajet
@@ -21,6 +21,10 @@ public class <%=genDiagram.getEditPartClassName()%> extends DiagramEditPart {
* @generated
*/
public static String MODEL_ID = "<%=genDiagram.getEditorGen().getModelID()%>";
+<%{
+GenCommonBase genCommonBase = genDiagram;%>
+<%@ include file="visualID.jetinc"%>
+<%}%>
/**
* @generated
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/EditPartFactory.javajet b/plugins/org.eclipse.gmf.codegen/templates/parts/EditPartFactory.javajet
index d79aa99de..1883865f5 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/EditPartFactory.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/EditPartFactory.javajet
@@ -52,7 +52,7 @@ public class <%=genDiagram.getEditPartFactoryClassName()%> implements EditPartFa
for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) {
GenContainerBase container = (GenContainerBase) containers.next();
%>
- case <%=container.getVisualID()%>:
+ case <%=importManager.getImportedName(container.getEditPartQualifiedClassName())%>.VISUAL_ID:
return new <%=container.getEditPartClassName()%>(view);
<%
if (container instanceof GenNode && !((GenNode) container).isListContainerEntry()) {
@@ -60,7 +60,7 @@ for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.
for (Iterator labels = node.getLabels().iterator(); labels.hasNext();) {
GenNodeLabel label = (GenNodeLabel) labels.next();
%>
- case <%=label.getVisualID()%>:
+ case <%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID:
return new <%=label.getEditPartClassName()%>(view);
<%
}
@@ -69,13 +69,13 @@ for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.
for (Iterator links = genDiagram.getLinks().iterator(); links.hasNext();) {
GenLink link = (GenLink) links.next();
%>
- case <%=link.getVisualID()%>:
+ case <%=importManager.getImportedName(link.getEditPartQualifiedClassName())%>.VISUAL_ID:
return new <%=link.getEditPartClassName()%>(view);
<%
for (Iterator linkLabels = link.getLabels().iterator(); linkLabels.hasNext();) {
GenLinkLabel linkLabel = (GenLinkLabel) linkLabels.next();
%>
- case <%=linkLabel.getVisualID()%>:
+ case <%=importManager.getImportedName(linkLabel.getEditPartQualifiedClassName())%>.VISUAL_ID:
return new <%=linkLabel.getEditPartClassName()%>(view);
<%
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/ExternalNodeLabelEditPart.javajet b/plugins/org.eclipse.gmf.codegen/templates/parts/ExternalNodeLabelEditPart.javajet
index f1b722efa..8a0eb8fd5 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/ExternalNodeLabelEditPart.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/ExternalNodeLabelEditPart.javajet
@@ -32,7 +32,7 @@ GenCommonBase genCommonBase = genLabel;%>
* @generated
*/
static {
- registerSnapBackPosition(<%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID, new Point(0, 0));
+ registerSnapBackPosition(<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID), new Point(0, 0));
}
/**
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/LinkLabelEditPart.javajet b/plugins/org.eclipse.gmf.codegen/templates/parts/LinkLabelEditPart.javajet
index 6fa44e84b..96583f0a3 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/LinkLabelEditPart.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/LinkLabelEditPart.javajet
@@ -41,9 +41,7 @@ if (labelOffset != null) {
labelOffsetY = labelOffset.getY();
}
%>
- registerSnapBackPosition(
- <%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID,
- new Point(<%=labelOffsetX%>, <%=labelOffsetY%>));
+ registerSnapBackPosition(<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID), new Point(<%=labelOffsetX%>, <%=labelOffsetY%>));
}
/**
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/NodeEditPart.javajet b/plugins/org.eclipse.gmf.codegen/templates/parts/NodeEditPart.javajet
index 49cc6ea73..9c53a8bea 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/NodeEditPart.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/NodeEditPart.javajet
@@ -83,7 +83,7 @@ if (!genNode.getChildNodes().isEmpty() || hasChildrenInListCompartments) {
%>
if (type == <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=child.getUniqueIdentifier()%>) {
<%=importManager.getImportedName("org.eclipse.gef.EditPart")%> compartmentEditPart =
- getChildBySemanticHint(<%=importManager.getImportedName(compartment.getEditPartQualifiedClassName())%>.VISUAL_ID);
+ getChildBySemanticHint(<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(compartment.getEditPartQualifiedClassName())%>.VISUAL_ID));
return compartmentEditPart == null ? null : compartmentEditPart.getCommand(request);
}
<%
@@ -334,7 +334,7 @@ if (!genNode.getLabels().isEmpty()) {
* @generated
*/
public <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> getPrimaryChildEditPart() {
- return getChildBySemanticHint(<%=importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())%>.VISUAL_ID);
+ return getChildBySemanticHint(<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())%>.VISUAL_ID));
}
<%
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/visualID.jetinc b/plugins/org.eclipse.gmf.codegen/templates/parts/visualID.jetinc
index 4107054ea..f390c0914 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/visualID.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/visualID.jetinc
@@ -2,4 +2,4 @@
/**
* @generated
*/
- public static String VISUAL_ID = "<%=genCommonBase.getVisualID()%>"; \ No newline at end of file
+ public static final int VISUAL_ID = <%=genCommonBase.getVisualID()%>; \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/providers/MetricProvider.javajet b/plugins/org.eclipse.gmf.codegen/templates/providers/MetricProvider.javajet
index 7c97a0a08..46fa7cec8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/providers/MetricProvider.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/providers/MetricProvider.javajet
@@ -600,7 +600,7 @@ for(Iterator it = genDiagram.getEditorGen().getMetrics().getMetrics().iterator()
<%@ include file="../expressions/initEnv.jetinc"%>
register(new MetricDef("<%=nextMetric.getKey()%>",
<%@ include file="../expressions/getExpression.jetinc"%>,
- <%=nextMetric.getTarget() instanceof GenDiagramElementTarget ? ((GenDiagramElementTarget)nextMetric.getTarget()).getElement().getVisualID() : -1%>,
+ <%=nextMetric.getTarget() instanceof GenDiagramElementTarget ? importManager.getImportedName(((GenDiagramElementTarget) nextMetric.getTarget()).getElement().getEditPartQualifiedClassName()) + ".VISUAL_ID" : "-1"%>,
<%if(nextMetric.getLowLimit()!=null){%>new Double(<%=nextMetric.getLowLimit()%>)<%}else{%>null<%}%>,
<%if(nextMetric.getHighLimit()!=null){%>new Double(<%=nextMetric.getHighLimit()%>)<%}else{%>null<%}%>,
<%if(nextMetric.getName()!=null){%>"<%=nextMetric.getName()%>"<%}else{%>null<%}%>,
diff --git a/plugins/org.eclipse.gmf.codegen/templates/providers/ParserProvider.javajet b/plugins/org.eclipse.gmf.codegen/templates/providers/ParserProvider.javajet
index 63f2621cb..980d78ce8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/providers/ParserProvider.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/providers/ParserProvider.javajet
@@ -143,7 +143,7 @@ for (Iterator it1 = labels.keySet().iterator(); it1.hasNext(); ) {
for (Iterator it2 = labelsList.iterator(); it2.hasNext(); ) {
GenLabel genLabel = (GenLabel) it2.next();
%>
- if (<%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID.equals(viewType)) {
+ if (<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID).equals(viewType)) {
return get<%=labelMethodNames.get(genLabel)%>();
}
<%
diff --git a/plugins/org.eclipse.gmf.codegen/templates/providers/ViewFactory.javajet b/plugins/org.eclipse.gmf.codegen/templates/providers/ViewFactory.javajet
index 11b3371cb..71b0f1be3 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/providers/ViewFactory.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/providers/ViewFactory.javajet
@@ -52,7 +52,7 @@ if (isDiagram) {
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter,
String semanticHint, int index, boolean persisted) {
if (semanticHint == null) { <%/* [++] importmant for the create shortcut functionality*/%>
- semanticHint = <%=genElement.getEditPartQualifiedClassName()%>.VISUAL_ID;
+ semanticHint = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=genElement.getEditPartQualifiedClassName()%>.VISUAL_ID);
view.setType(semanticHint);
}<%/* [--] importmant for the create shortcut functionality*/%>
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
@@ -82,7 +82,7 @@ if (isNode) {
for (int j = 0; j < labels.size(); j++) {
GenNodeLabel label = (GenNodeLabel) labels.get(j);
%>
- getViewService().createNode(semanticAdapter, view, <%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID,
+ getViewService().createNode(semanticAdapter, view, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID),
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")%>.APPEND, true, getPreferencesHint());
<%
}
@@ -91,7 +91,7 @@ if (isNode) {
for (int j = 0; j < genChildContainers.size(); j++) {
GenCompartment genChildContainer = (GenCompartment) genChildContainers.get(j);
%>
- getViewService().createNode(semanticAdapter, view, <%=importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName())%>.VISUAL_ID,
+ getViewService().createNode(semanticAdapter, view, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(genChildContainer.getEditPartQualifiedClassName())%>.VISUAL_ID),
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")%>.APPEND, true, getPreferencesHint());
<%
}
@@ -101,7 +101,7 @@ if (isNode) {
for (int j = 0; j < labels.size(); j++) {
GenLinkLabel label = (GenLinkLabel) labels.get(j);
%>
- getViewService().createNode(semanticAdapter, view, <%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID,
+ getViewService().createNode(semanticAdapter, view, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID),
<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.core.util.ViewUtil")%>.APPEND, true, getPreferencesHint());
<%
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/providers/ViewProvider.javajet b/plugins/org.eclipse.gmf.codegen/templates/providers/ViewProvider.javajet
index 115b67027..21d831e20 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/providers/ViewProvider.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/providers/ViewProvider.javajet
@@ -54,7 +54,7 @@ public class <%=genDiagram.getNotationViewProviderClassName()%> extends Abstract
for (Iterator containers = genDiagram.getAllChildContainers().iterator(); containers.hasNext();) {
GenContainerBase container = (GenContainerBase) containers.next();
%>
- case <%=container.getVisualID()%>:
+ case <%=importManager.getImportedName(container.getEditPartQualifiedClassName())%>.VISUAL_ID:
return <%=importManager.getImportedName(container.getNotationViewFactoryQualifiedClassName())%>.class;
<%
if (container instanceof GenNode && !((GenNode) container).isListContainerEntry()) {
@@ -62,7 +62,7 @@ for (Iterator containers = genDiagram.getAllChildContainers().iterator(); contai
for (Iterator labels = node.getLabels().iterator(); labels.hasNext();) {
GenNodeLabel label = (GenNodeLabel) labels.next();
%>
- case <%=label.getVisualID()%>:
+ case <%=importManager.getImportedName(label.getEditPartQualifiedClassName())%>.VISUAL_ID:
return <%=importManager.getImportedName(label.getNotationViewFactoryQualifiedClassName())%>.class;
<%
}
@@ -73,7 +73,7 @@ for (Iterator links = genLinks.iterator(); links.hasNext();) {
for (Iterator linkLabels = link.getLabels().iterator(); linkLabels.hasNext();) {
GenLinkLabel linkLabel = (GenLinkLabel) linkLabels.next();
%>
- case <%=linkLabel.getVisualID()%>:
+ case <%=importManager.getImportedName(linkLabel.getEditPartQualifiedClassName())%>.VISUAL_ID:
return <%=importManager.getImportedName(linkLabel.getNotationViewFactoryQualifiedClassName())%>.class;
<%
}
@@ -118,7 +118,7 @@ for (int i = 0; i < genLinks.size(); i++) {
GenLink genLink = (GenLink) genLinks.get(i);
if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
%>
- case <%=genLink.getVisualID()%>:
+ case <%=importManager.getImportedName(genLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
return <%=importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())%>.class;
<%
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc
index 787f5641f..ce2c211b2 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectDiagramPhantoms_header.jetinc
@@ -12,4 +12,4 @@ for (<%=importManager.getImportedName("java.util.Iterator")%> it = resource.getC
for (Iterator phantoms = genClass2Phantom.values().iterator(); phantoms.hasNext();) {
GenTopLevelNode phantomNode = (GenTopLevelNode) phantoms.next();
%>
- case <%=phantomNode.getVisualID()%>: { \ No newline at end of file
+ case <%=importManager.getImportedName(phantomNode.getEditPartQualifiedClassName())%>.VISUAL_ID: { \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc
index 29db531cb..a6d49c23d 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectFMFLinks_header.jetinc
@@ -18,5 +18,5 @@ if (phantomsOnly ? (!genFeature.isContains() || phantomNode == null) : (genFeatu
<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextDestination = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%=getFeatureValueGetter("container", genFeature, true, importManager)%>;
<% }%>
<% if (phantomsOnly) {%>
- if (<%=phantomNode.getVisualID()%> == <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(diagram, nextDestination)) {
+ if (<%=importManager.getImportedName(phantomNode.getEditPartQualifiedClassName())%>.VISUAL_ID == <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(diagram, nextDestination)) {
<% }%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc
index 6f614452c..d9bf776a7 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/collectSemanticChildren_header.jetinc
@@ -39,7 +39,7 @@ for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
GenNode nextNode = (GenNode) genNodesIterator.next();
if (generateSwitch) {%>
- case <%=nextNode.getVisualID()%>: {
+ case <%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID: {
<% } else {%>
- if (<%=nextNode.getVisualID()%> == nodeVID) {
+ if (<%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID == nodeVID) {
<% }%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/initDiagramContents.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/initDiagramContents.jetinc
index 357cf6542..ba4c189cf 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/initDiagramContents.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/initDiagramContents.jetinc
@@ -19,7 +19,7 @@ private <%=importManager.getImportedName("java.util.Map")%> myEObject2NodeMap =
private void initDiagramContents(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> diagram, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> diagramModelObject) {
create<%=genDiagram.getUniqueIdentifier()%>Children(diagram, diagramModelObject);
<%@ include file="collectDiagramPhantoms_header.jetinc"%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(diagram, nextResourceObject, <%=importManager.getImportedName(phantomNode.getEditPartQualifiedClassName())%>.VISUAL_ID, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(diagram, nextResourceObject, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(phantomNode.getEditPartQualifiedClassName())%>.VISUAL_ID), <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
myEObject2NodeMap.put(nextResourceObject, nextNode);
create<%=phantomNode.getUniqueIdentifier()%>Children(nextNode, nextResourceObject);
<%@ include file="collectDiagramPhantoms_footer.jetinc"%>
@@ -42,7 +42,7 @@ private void create<%=nextContainer.getUniqueIdentifier()%>Children(<%=importMan
<% {
List genNodes = nextContainer.getContainedNodes();%>
<%@ include file="collectSemanticChildren_header.jetinc"%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(viewObject, nextValue, <%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID, <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(viewObject, nextValue, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID), <%=pluginActivatorClass%>.DIAGRAM_PREFERENCES_HINT);
myEObject2NodeMap.put(nextValue, nextNode);
create<%=nextNode.getUniqueIdentifier()%>Children(nextNode, nextValue);
<%@ include file="collectSemanticChildren_footer.jetinc"%>
@@ -54,7 +54,7 @@ private void create<%=nextContainer.getUniqueIdentifier()%>Children(<%=importMan
generateGetCompartment = true;
GenCompartment nextCompartment = (GenCompartment) nextNode.getCompartments().get(i);
%>
- <%=i == 0 ? importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node") : ""%> nextCompartment = getCompartment(viewObject, <%=importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName())%>.VISUAL_ID);
+ <%=i == 0 ? importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node") : ""%> nextCompartment = getCompartment(viewObject, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName())%>.VISUAL_ID));
if (nextCompartment != null) {
create<%=nextCompartment.getUniqueIdentifier()%>Children(nextCompartment, modelObject);
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticDiagram.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticDiagram.jetinc
index f37db4c3b..8d64db47d 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticDiagram.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/refreshSemanticDiagram.jetinc
@@ -82,7 +82,7 @@ for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.
continue;
}
%>
- case <%=nextContainer.getVisualID()%>:<%
+ case <%=importManager.getImportedName(nextContainer.getEditPartQualifiedClassName())%>.VISUAL_ID:<%
} %> { myEObject2ViewMap.put(modelElement, view);
storeLinks(modelElement, getDiagram());
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/storeLinks.jetinc b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/storeLinks.jetinc
index fef4a8bb0..9796c4841 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/storeLinks.jetinc
+++ b/plugins/org.eclipse.gmf.codegen/templates/semanticSync.jetinc/storeLinks.jetinc
@@ -36,7 +36,7 @@ for (Iterator it = genLinks.iterator(); it.hasNext();) {
<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> src = container;
<% }%>
int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(nextValue);
- if (<%=nextLink.getVisualID()%> == linkVID) {
+ if (<%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID == linkVID) {
myLinkDescriptors.add(new LinkDescriptor(src, dst, nextValue, linkVID));
}
<% if (typeLinkModelFacet.getSourceMetaFeature() != null) {%>
@@ -66,9 +66,9 @@ for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
boolean phantomsOnly = true;
%>
<%@ include file="collectFMFLinks_header.jetinc"%>
- myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=nextLink.getUniqueIdentifier()%>, <%=nextLink.getVisualID()%>));
+ myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=nextLink.getUniqueIdentifier()%>, <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID));
<% if (createPhantoms) {%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(diagram, nextDestination, <%=importManager.getImportedName(phantomNode.getEditPartQualifiedClassName())%>.VISUAL_ID, <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.DIAGRAM_PREFERENCES_HINT);
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> nextNode = ViewService.createNode(diagram, nextDestination, <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getType(<%=importManager.getImportedName(phantomNode.getEditPartQualifiedClassName())%>.VISUAL_ID), <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.DIAGRAM_PREFERENCES_HINT);
myEObject2NodeMap.put(nextDestination, nextNode);
create<%=phantomNode.getUniqueIdentifier()%>Children(nextNode, nextDestination);
<% }%>
@@ -80,7 +80,7 @@ for (int linkIndex = 0; linkIndex < genLinks.size(); linkIndex++) {
boolean phantomsOnly = false;
%>
<%@ include file="collectFMFLinks_header.jetinc"%>
- myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=nextLink.getUniqueIdentifier()%>, <%=nextLink.getVisualID()%>));
+ myLinkDescriptors.add(new LinkDescriptor(container, nextDestination, <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.<%=nextLink.getUniqueIdentifier()%>, <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID));
<%@ include file="collectFMFLinks_footer.jetinc"%>
<%}%>
} \ No newline at end of file

Back to the top