Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-11-02 16:58:29 -0500
committeratikhomirov2006-11-02 16:58:29 -0500
commit87f9ae89b931710cf24bd695b81ab8e3d219c88a (patch)
treec0382fe2792d9359c1ee17ca9a346eb22bf21b29 /plugins/org.eclipse.gmf.graphdef.codegen/templates/new
parentbfa530a7515d8bc44f9d0c4d89d6db7ad9403dda (diff)
downloadorg.eclipse.gmf-tooling-87f9ae89b931710cf24bd695b81ab8e3d219c88a.tar.gz
org.eclipse.gmf-tooling-87f9ae89b931710cf24bd695b81ab8e3d219c88a.tar.xz
org.eclipse.gmf-tooling-87f9ae89b931710cf24bd695b81ab8e3d219c88a.zip
JET templates for gmfgraph model replaced with Xpand counterparts.
MapMode handling simplified
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/new')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CompoundBorder.javajet17
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CustomBorder.javajet11
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Figure.javajet14
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Layout.javajet21
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LayoutData.javajet18
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LineBorder.javajet35
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/new/MarginBorder.javajet24
7 files changed, 0 insertions, 140 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CompoundBorder.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CompoundBorder.javajet
deleted file mode 100644
index b0c1953d3..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CompoundBorder.javajet
+++ /dev/null
@@ -1,17 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewCompoundBorderExpressionGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.gmf.common.codegen.ImportAssistant"%>
-<%
-Object[] args = (Object[]) argument;
-final CompoundBorder border = (CompoundBorder)args[0];
-final GraphDefDispatcher dispatcher = (GraphDefDispatcher)args[1];
-final ImportAssistant importManager = dispatcher.getImportManager();
-
-//We want NEITHER insert any names into the scope NOR produce statement. We need expression instead.
-%>
- <% Border outer = border.getOuter();
- Border inner = border.getInner();
- %>
-new <%=importManager.getImportedName("org.eclipse.draw2d.CompoundBorder")%>(
- <%= (outer == null) ? "null" : dispatcher.dispatch(outer, new Object[]{outer, dispatcher})%>,
- <%= (inner == null) ? "null" : dispatcher.dispatch(inner, new Object[]{inner, dispatcher})%>
-)
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CustomBorder.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CustomBorder.javajet
deleted file mode 100644
index e77fec827..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/CustomBorder.javajet
+++ /dev/null
@@ -1,11 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewCustomBorderExpressionGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
-<%
-Object[] args = (Object[]) argument;
-final CustomBorder border = (CustomBorder)args[0];
-final GraphDefDispatcher dispatcher = (GraphDefDispatcher)args[1];
-//final ImportAssistant importManager = dispatcher.getImportManager();
-
-//We want NEITHER insert any names into the scope NOR produce statement. We need expression instead.
-//@see customBorderFactoryMethod.jetinc
-%><%=dispatcher.getAuxiliaryDataStorage().getRegisteredData(border)%>()
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Figure.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Figure.javajet
deleted file mode 100644
index 8fdb00dfc..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Figure.javajet
+++ /dev/null
@@ -1,14 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewFigureGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
-<%
-GraphDefDispatcher.Args args = (GraphDefDispatcher.Args) argument;
-final Figure figureInstance = args.getFigure();
-final String figureVarName = args.getVariableName();
-final GraphDefDispatcher dispatcher = args.getDispatcher();
-final String figureClassName = dispatcher.getFQNSwitch().get(figureInstance, dispatcher.getImportManager());
-
-// PRODUCES instance AND (!) initializes attributes
-%>
-<%=figureClassName%> <%=figureVarName%> = new <%=figureClassName%>();
-<%=args.getDispatcher().dispatch(figureInstance, args)%>
-<%=args.getDispatcher().dispatch("createLayout", dispatcher.getLayoutArgsFor(args))%>
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Layout.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Layout.javajet
deleted file mode 100644
index e298ae16c..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/Layout.javajet
+++ /dev/null
@@ -1,21 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewLayoutGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
-<%
-GraphDefDispatcher.LayoutArgs argsBundle = (GraphDefDispatcher.LayoutArgs) argument;
-final FigureMarker figureMarker = argsBundle.getFigure();
-final String figureVarName = argsBundle.getVariableName();
-final String layouterVarName = argsBundle.getManagerVariableName();
-final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
-%>
-
-<%
-Layout gmfLayout= figureMarker.getLayout();
-if (gmfLayout != null){
- final String layouterImplClass = dispatcher.getFQNSwitch().get(gmfLayout, dispatcher.getImportManager());
-%>
- <%=layouterImplClass%> <%=layouterVarName%> = new <%=layouterImplClass%>();
- <%=argsBundle.getDispatcher().dispatch(gmfLayout, argsBundle)%>
- <%=figureVarName%>.setLayoutManager(<%=layouterVarName%>);
-<%
-}
-%>
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LayoutData.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LayoutData.javajet
deleted file mode 100644
index 5fca8b7ec..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LayoutData.javajet
+++ /dev/null
@@ -1,18 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewLayoutDataGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.*"%>
-<%
-// NOTE: this code expects that constrainted figure is already added to its parent
-
-GraphDefDispatcher.LayoutArgs argsBundle = (GraphDefDispatcher.LayoutArgs) argument;
-final GraphDefDispatcher dispatcher = argsBundle.getDispatcher();
-final LayoutData gmfLayoutData = argsBundle.getData();
-final Figure figureInstance = argsBundle.getFigure();
-
-// merely makes sure layoutData present
-// and parent figure got chance to have layout initialized
-
-if (gmfLayoutData != null && figureInstance.eContainer() instanceof Figure && ((Figure) figureInstance.eContainer()).getLayout() != null) {%>
-<%=dispatcher.dispatch(gmfLayoutData, argsBundle)%>
-<%} else {%>
- Object <%=argsBundle.getConstraintVariableName()%> = null;
-<%}%>
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LineBorder.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LineBorder.javajet
deleted file mode 100644
index 35824e222..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/LineBorder.javajet
+++ /dev/null
@@ -1,35 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewLineBorderExpressionGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.gmf.common.codegen.ImportAssistant"%>
-<%
-Object[] args = (Object[]) argument;
-final LineBorder border = (LineBorder)args[0];
-final GraphDefDispatcher dispatcher = (GraphDefDispatcher)args[1];
-final ImportAssistant importManager = dispatcher.getImportManager();
-
-//We do not want to insert any names into the scope.
-//We want to provide EXPRESSION instead of statement
-%>
-<%
- String borderClazz = importManager.getImportedName("org.eclipse.draw2d.LineBorder");
- boolean hasColor = border.eIsSet(GMFGraphPackage.eINSTANCE.getLineBorder_Color());
- boolean hasWidth = border.eIsSet(GMFGraphPackage.eINSTANCE.getLineBorder_Width());
- Color colorVal = (hasColor) ? border.getColor() : null;
- String colorName = (hasColor) ? "BORDER" : null;
- if (hasColor && hasWidth){
-%>
-new <%=borderClazz%>(<%@ include file="../Color.jetinc"%>, <%=dispatcher.DPtoLP(border.getWidth())%>)
-<%
- } else if (hasColor && !hasWidth) {
-%>
-new <%=borderClazz%>(<%@ include file="../Color.jetinc"%>)
-<%
- } else if (!hasColor && hasWidth){
-%>
-new <%=borderClazz%>(<%=dispatcher.DPtoLP(border.getWidth())%>)
-<%
- } else {
-%>
-new <%=borderClazz%>()
-<%
- }
-%>
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/MarginBorder.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/MarginBorder.javajet
deleted file mode 100644
index 30a8c2a76..000000000
--- a/plugins/org.eclipse.gmf.graphdef.codegen/templates/new/MarginBorder.javajet
+++ /dev/null
@@ -1,24 +0,0 @@
-<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="NewMarginBorderExpressionGenerator"
- imports="org.eclipse.gmf.gmfgraph.* org.eclipse.gmf.graphdef.codegen.* org.eclipse.gmf.common.codegen.ImportAssistant"%>
-<%
-Object[] args = (Object[]) argument;
-final MarginBorder border = (MarginBorder)args[0];
-final GraphDefDispatcher dispatcher = (GraphDefDispatcher)args[1];
-final ImportAssistant importManager = dispatcher.getImportManager();
-
-//Produces EXPRESSION instead of statement
-%>
-<%
- int top = 0;
- int left = 0;
- int bottom = 0;
- int right = 0;
- if (border.eIsSet(GMFGraphPackage.eINSTANCE.getMarginBorder_Insets())){
- Insets insets = border.getInsets();
- top = insets.getTop();
- left = insets.getLeft();
- bottom = insets.getBottom();
- right = insets.getRight();
- }
-%>
-new <%=importManager.getImportedName("org.eclipse.draw2d.MarginBorder")%>(<%=dispatcher.DPtoLP(top)%>, <%=dispatcher.DPtoLP(left)%>, <%=dispatcher.DPtoLP(bottom)%>, <%=dispatcher.DPtoLP(right)%>)

Back to the top