Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-02-13 12:36:07 -0500
committeratikhomirov2006-02-13 12:36:07 -0500
commitf8757a97d7e3a5e73cbc0be2d438e3921bc2a2e8 (patch)
treec3712afb5d03429a0b1f9a44a2694d1fb180ef5b /plugins/org.eclipse.gmf.graphdef.codegen/templates/attr
parent80e4035d3bf83b8a35983bc23587f49485a14d3e (diff)
downloadorg.eclipse.gmf-tooling-f8757a97d7e3a5e73cbc0be2d438e3921bc2a2e8.tar.gz
org.eclipse.gmf-tooling-f8757a97d7e3a5e73cbc0be2d438e3921bc2a2e8.tar.xz
org.eclipse.gmf-tooling-f8757a97d7e3a5e73cbc0be2d438e3921bc2a2e8.zip
[mgolubev] #127252 layout support
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/attr')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.javajet36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.javajet b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.javajet
new file mode 100644
index 000000000..5d7424e22
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/attr/CustomClass.javajet
@@ -0,0 +1,36 @@
+<%@ jet package="org.eclipse.gmf.graphdef.codegen.templates" class="CustomClassAttributesGenerator"
+ imports="org.eclipse.gmf.gmfgraph.* org.eclipse.emf.codegen.util.CodeGenUtil java.util.* "%>
+<%
+final CustomClass instance = (CustomClass) ((Object[]) argument)[0];
+//final GraphDefDispatcher dispatcher = (GraphDefDispatcher) ((Object[]) argument)[1];
+final String varName = (String) ((Object[]) argument)[2];
+%>
+
+ {
+<%
+int attrIndex = 0;
+for (Iterator attrs = instance.getAttributes().iterator(); attrs.hasNext(); attrIndex++){
+ CustomAttribute next = (CustomAttribute) attrs.next();
+ String varValue;
+ if (next.isMultiStatementValue()){
+ varValue = "attr" + attrIndex;
+%>
+ <%=java.text.MessageFormat.format(next.getValue(), new Object[] {varValue})%>;
+<% } else {
+ varValue = next.getValue();
+}
+ if (next.isDirectAccess()) {
+%>
+ <%=varName%>.<%=next.getName()%> = <%=varValue%>;
+<%
+ } else {
+%>
+ <%=varName%>.set<%=CodeGenUtil.capName(next.getName())%>(<%=varValue%>);
+<%
+ }
+%>
+<%
+} //for
+%>
+ }
+

Back to the top