Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2011-09-16 00:33:31 +0000
committerWinston Prakash2011-09-16 00:33:31 +0000
commitc74a6240b309125e185126ec4214a748b73eb1a9 (patch)
tree931dd006e49f6cb506257e0e0cbc0eb399153526 /hudson-core/src/main/resources/lib/form/hetero-radio.jelly
downloadorg.eclipse.hudson.core-c74a6240b309125e185126ec4214a748b73eb1a9.tar.gz
org.eclipse.hudson.core-c74a6240b309125e185126ec4214a748b73eb1a9.tar.xz
org.eclipse.hudson.core-c74a6240b309125e185126ec4214a748b73eb1a9.zip
Initial commit of hudson-core files which are approved via CQ 5461
Diffstat (limited to 'hudson-core/src/main/resources/lib/form/hetero-radio.jelly')
-rw-r--r--hudson-core/src/main/resources/lib/form/hetero-radio.jelly48
1 files changed, 48 insertions, 0 deletions
diff --git a/hudson-core/src/main/resources/lib/form/hetero-radio.jelly b/hudson-core/src/main/resources/lib/form/hetero-radio.jelly
new file mode 100644
index 00000000..6792f0fd
--- /dev/null
+++ b/hudson-core/src/main/resources/lib/form/hetero-radio.jelly
@@ -0,0 +1,48 @@
+<!-- **************************************************************************
+#
+# Copyright (c) 2004-2009 Oracle Corporation.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#
+# Kohsuke Kawaguchi
+#
+#
+#************************************************************************** -->
+
+
+<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:local="local">
+ <st:documentation>
+ Sibling of hetero-list, which only allows the user to pick one type from the list of descriptors and configure it.
+
+ <st:attribute name="field" use="required">
+ Field name in the parent object where databinding happens.
+ </st:attribute>
+ <st:attribute name="descriptors" use="required">
+ all types that the user can add.
+ </st:attribute>
+ </st:documentation>
+
+ <f:prepareDatabinding />
+
+ <table style="width:100%">
+ <j:set var="currentInstance" value="${instance[field]}" />
+ <j:set var="currentDescriptor" value="${currentInstance.descriptor}" />
+ <j:forEach var="d" items="${descriptors}" varStatus="loop">
+ <f:radioBlock name="${field}" help="${d.helpFile}" value="${loop.index}"
+ title="${d.displayName}" checked="${currentDescriptor==d}">
+ <j:set var="descriptor" value="${d}" />
+ <j:set var="instance" value="${currentDescriptor==d?currentInstance:null}" />
+ <st:include from="${d}" page="${d.configPage}" optional="true" />
+
+ <f:invisibleEntry><!-- this tells Stapler which block is for which class -->
+ <input type="hidden" name="stapler-class" value="${d.clazz.name}" />
+ </f:invisibleEntry>
+ </f:radioBlock>
+ </j:forEach>
+ </table>
+</j:jelly>

Back to the top