Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-02-04 22:34:49 +0000
committeratikhomirov2006-02-04 22:34:49 +0000
commit7a5bc7afc1360de4b7d034362a58593eec25b9f7 (patch)
tree65e98fcc98de35e5c5b55245e41195dc01200f4a /plugins/org.eclipse.gmf.graphdef.codegen/templates
parent03c14d9d5f8749d1c9533c2d653fec5e31a5ce16 (diff)
downloadorg.eclipse.gmf-tooling-7a5bc7afc1360de4b7d034362a58593eec25b9f7.tar.gz
org.eclipse.gmf-tooling-7a5bc7afc1360de4b7d034362a58593eec25b9f7.tar.xz
org.eclipse.gmf-tooling-7a5bc7afc1360de4b7d034362a58593eec25b9f7.zip
provide option to use importManager
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/ConcreteShape.javajet12
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/CustomFigure.javajet12
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/DecorationFigure.javajet12
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/Label.javajet12
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/PolylineConnection.javajet12
5 files changed, 40 insertions, 20 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/ConcreteShape.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/ConcreteShape.javajet
index 279419fca..e7b74457c 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/ConcreteShape.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/ConcreteShape.javajet
@@ -1,14 +1,18 @@
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="ShapeGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* java.util.*"%>
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* java.util.*"%>
<%
-Shape shapeFig = (Shape) argument;
+Object[] args = (Object[]) argument;
+Shape shapeFig = (Shape) args[0];
+final ImportAssistant importManager = (ImportAssistant) args[1];
final GMFGraphSwitch fqnSwitch = new FigureQualifiedNameSwitch();
%>
+<%importManager.markImportLocation(stringBuffer);%>
+
/**
* @generated
*/
-public class <%=shapeFig.getName()%> extends <%=fqnSwitch.doSwitch(shapeFig)%> {
+public class <%=shapeFig.getName()%> extends <%=importManager.getImportedName((String) fqnSwitch.doSwitch(shapeFig))%> {
/**
* @generated
@@ -64,4 +68,4 @@ String figureVarName = parentFigureVarName;%>
}
<%}%>
-} \ No newline at end of file
+}<%importManager.emitSortedImports();%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/CustomFigure.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/CustomFigure.javajet
index c0c08c519..467bb587f 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/CustomFigure.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/CustomFigure.javajet
@@ -1,14 +1,18 @@
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="CustomFigureGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* java.util.*"%>
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* java.util.*"%>
<%
-CustomFigure figure = (CustomFigure) argument;
+Object[] args = (Object[]) argument;
+CustomFigure figure = (CustomFigure) args[0];
+final ImportAssistant importManager = (ImportAssistant) args[1];
final GMFGraphSwitch fqnSwitch = new FigureQualifiedNameSwitch();
%>
+<%importManager.markImportLocation(stringBuffer);%>
+
/**
* @generated
*/
-public class <%=figure.getName()%> extends <%=figure.getQualifiedClassName()%> {
+public class <%=figure.getName()%> extends <%=importManager.getImportedName(figure.getQualifiedClassName())%> {
/**
* @generated
@@ -18,4 +22,4 @@ public class <%=figure.getName()%> extends <%=figure.getQualifiedClassName()%> {
<%String parentFigureVarName = "this";%>
<%@ include file="FigureChildren.jetinc" %>
}
-} \ No newline at end of file
+}<%importManager.emitSortedImports();%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/DecorationFigure.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/DecorationFigure.javajet
index 0b613d8c0..ca932986c 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/DecorationFigure.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/DecorationFigure.javajet
@@ -1,17 +1,21 @@
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="DecorationFigureGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* java.util.*"%>
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* java.util.*"%>
<%
-DecorationFigure figure = (DecorationFigure) argument;
+Object[] args = (Object[]) argument;
+DecorationFigure figure = (DecorationFigure) args[0];
+final ImportAssistant importManager = (ImportAssistant) args[1];
assert false == figure instanceof CustomFigure;
final Point scale;
scale = null; //XXX
final GMFGraphSwitch fqnSwitch = new FigureQualifiedNameSwitch();
%>
+<%importManager.markImportLocation(stringBuffer);%>
+
/**
* @generated
*/
-class <%=figure.getName()%> extends <%=fqnSwitch.doSwitch(figure)%> {
+class <%=figure.getName()%> extends <%=importManager.getImportedName((String) fqnSwitch.doSwitch(figure))%> {
/**
* @generated
@@ -25,4 +29,4 @@ String decFigVarName = "this";%>
setScale(<%=scale.getX()%>, <%=scale.getY()%>);
<%}%>
}
-}
+}<%importManager.emitSortedImports();%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Label.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Label.javajet
index c964bddff..ecbd3eb02 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Label.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Label.javajet
@@ -1,14 +1,18 @@
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="LabelGenerator"
- imports="org.eclipse.gmf.gmfgraph.*"%>
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.common.codegen.*"%>
<%
-Label figure = (Label) argument;
+Object[] args = (Object[]) argument;
+Label figure = (Label) args[0];
+final ImportAssistant importManager = (ImportAssistant) args[1];
%>
+<%importManager.markImportLocation(stringBuffer);%>
+
/**
* @generated
*/
-public class <%=figure.getName()%> extends org.eclipse.draw2d.Label {
+public class <%=figure.getName()%> extends <%=importManager.getImportedName("org.eclipse.draw2d.Label")%> {
/**
* @generated
@@ -17,4 +21,4 @@ public class <%=figure.getName()%> extends org.eclipse.draw2d.Label {
super();
}
-}
+}<%importManager.emitSortedImports();%> \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/PolylineConnection.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/PolylineConnection.javajet
index 9596af38a..ed1c25606 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/PolylineConnection.javajet
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/PolylineConnection.javajet
@@ -1,15 +1,19 @@
<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="ConnectionGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* java.util.*"%>
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.gmfgraph.util.* org.eclipse.gmf.common.codegen.* java.util.*"%>
<%
-PolylineConnection figure = (PolylineConnection) argument;
+Object[] args = (Object[]) argument;
+PolylineConnection figure = (PolylineConnection) args[0];
+final ImportAssistant importManager = (ImportAssistant) args[1];
final GMFGraphSwitch fqnSwitch = new FigureQualifiedNameSwitch();
%>
+<%importManager.markImportLocation(stringBuffer);%>
+
/**
* @generated
*/
-public class <%=figure.getName()%> extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {
+public class <%=figure.getName()%> extends <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx")%> {
/**
* @generated
@@ -49,4 +53,4 @@ DecorationFigure df = figure.getTargetDecoration();%>
return <%=decFigVarName%>;
}
<%}%>
-}
+}<%importManager.emitSortedImports();%> \ No newline at end of file

Back to the top