提交 a5eecaa4 编写于 作者: J Jesse Glick

Rather than patching configure.jelly, safer and clearer to directly adjust...

Rather than patching configure.jelly, safer and clearer to directly adjust ToolInstallation/global.jelly.
上级 16a8339a
......@@ -679,18 +679,6 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
return type.isAssignableFrom(clazz);
}
/**
* Like {@link #isSubTypeOf(Class)} but usable from Jelly scripts.
* @since XXX
*/
public final boolean isSubTypeOf(String type) {
try {
return Class.forName(type, true, clazz.getClassLoader()).isAssignableFrom(clazz);
} catch (ClassNotFoundException x) {
return false;
}
}
/**
* @deprecated
* As of 1.239, use {@link #configure(StaplerRequest, JSONObject)}.
......
......@@ -23,21 +23,33 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<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">
<f:section title="${descriptor.displayName}">
<f:entry title="${%title(descriptor.displayName)}" description="${%description(descriptor.displayName)}">
<f:repeatable name="tool" var="instance" items="${descriptor.installations}"
add="${%label.add(descriptor.displayName)}" header="${descriptor.displayName}">
<j:set var="toolDescriptor" value="${descriptor}" /><!-- to make this descriptor accessible from properties -->
<table width="100%">
<st:include page="config.jelly" from="${descriptor}" class="${descriptor.clazz}"/>
<f:descriptorList descriptors="${descriptor.propertyDescriptors}" field="properties"/>
<f:entry title="">
<div align="right">
<f:repeatableDeleteButton value="${%label.delete(descriptor.displayName)}"/>
</div>
</f:entry>
</table>
</f:repeatable>
</f:entry>
</f:section>
<tr>
<td colspan="3"> <!-- f:advanced does not work well here because of placement in third column -->
<st:adjunct includes="lib.form.advanced.advanced"/>
<div class="advancedLink" style="text-align:left">
<input type="button" value="${%title(descriptor.displayName)}..." class="advanced-button advancedButton"/>
</div>
<table class="advancedBody">
<tbody>
<f:section title="${descriptor.displayName}">
<f:entry title="${%title(descriptor.displayName)}" description="${%description(descriptor.displayName)}">
<f:repeatable name="tool" var="instance" items="${descriptor.installations}"
add="${%label.add(descriptor.displayName)}" header="${descriptor.displayName}">
<j:set var="toolDescriptor" value="${descriptor}" /><!-- to make this descriptor accessible from properties -->
<table width="100%">
<st:include page="config.jelly" from="${descriptor}" class="${descriptor.clazz}"/>
<f:descriptorList descriptors="${descriptor.propertyDescriptors}" field="properties"/>
<f:entry title="">
<div align="right">
<f:repeatableDeleteButton value="${%label.delete(descriptor.displayName)}"/>
</div>
</f:entry>
</table>
</f:repeatable>
</f:entry>
</f:section>
</tbody>
</table>
</td>
</tr>
</j:jelly>
......@@ -56,26 +56,7 @@ THE SOFTWARE.
<j:forEach var="descriptor" items="${h.getSortedDescriptorsForGlobalConfig()}">
<j:set var="instance" value="${descriptor}" /><!-- this makes the <f:textbox field=.../> work -->
<f:rowSet name="${descriptor.jsonSafeClassName}">
<j:choose>
<j:when test="${descriptor.isSubTypeOf('hudson.tools.ToolInstallation')}"> <!-- JENKINS-14538: shown specially -->
<tr>
<td colspan="3"> <!-- f:advanced does not work well here because of placement in third column -->
<st:adjunct includes="lib.form.advanced.advanced"/>
<div class="advancedLink" style="text-align:left">
<input type="button" value="${%tool.installations(descriptor.displayName)}" class="advanced-button advancedButton"/>
</div>
<table class="advancedBody">
<tbody>
<st:include page="${descriptor.globalConfigPage}" from="${descriptor}"/>
</tbody>
</table>
</td>
</tr>
</j:when>
<j:otherwise> <!-- most global descriptors -->
<st:include page="${descriptor.globalConfigPage}" from="${descriptor}" />
</j:otherwise>
</j:choose>
<st:include page="${descriptor.globalConfigPage}" from="${descriptor}" />
</f:rowSet>
</j:forEach>
......
......@@ -28,4 +28,3 @@ statsBlurb=\
Help make Jenkins better by sending anonymous usage statistics and crash reports to the Jenkins project.
no.such.JDK=<span class=error>No such JDK exists</span>
tool.installations={0} installations...
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册