Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'examples/org.eclipse.jet.ec2008.swtgen.codebehind/templates/wizardPage/flattenControl.jet')
-rw-r--r--examples/org.eclipse.jet.ec2008.swtgen.codebehind/templates/wizardPage/flattenControl.jet29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/org.eclipse.jet.ec2008.swtgen.codebehind/templates/wizardPage/flattenControl.jet b/examples/org.eclipse.jet.ec2008.swtgen.codebehind/templates/wizardPage/flattenControl.jet
new file mode 100644
index 0000000..15ea6fc
--- /dev/null
+++ b/examples/org.eclipse.jet.ec2008.swtgen.codebehind/templates/wizardPage/flattenControl.jet
@@ -0,0 +1,29 @@
+<%!
+/* Copyright 2008 IBM Corp. All rights reserved. This source code is made available under the terms of the Eclipse Public License, v1.0. */
+%>
+<%-- parentControl : name of parent control or empty string
+ control : current control element or empty string
+--%>
+ <control
+ type="<c:get select="local-name($control)"/>"
+ parent="<c:get select="$parentControl"/>"
+ <%-- copy attributes --%>
+ <c:iterate select="$control/@*" var="attr">
+ <c:get select="local-name($attr)"/>="<f:replaceAll value="&" replacement="&amp;"><c:get select="$attr"/></f:replaceAll>"
+ </c:iterate>
+ >
+<%-- copy elements (gridData|gridLayout|event|item) as child elements --%>
+ <c:iterate select="$control/gridLayout | $control/gridData | $control/event | $control/item"
+ var="childData">
+ <c:dump select="$childData"/>
+ </c:iterate>
+<%-- close control element --%>
+ </control>
+<c:setVariable var="parentControl" select="string($control/@name)"/>
+<%-- process child control elements at same depth as parent --%>
+<c:iterate select="$control/*"
+ var="control">
+ <c:if test="not(local-name($control) = 'gridData' or local-name($control) = 'gridLayout' or local-name($control) = 'event' or local-name($control) = 'item')">
+ <c:include template="templates/wizardPage/flattenControl.jet" passVariables="control,parentControl"/>
+ </c:if>
+</c:iterate>

Back to the top