提交 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 { ...@@ -679,18 +679,6 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
return type.isAssignableFrom(clazz); 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 * @deprecated
* As of 1.239, use {@link #configure(StaplerRequest, JSONObject)}. * As of 1.239, use {@link #configure(StaplerRequest, JSONObject)}.
......
...@@ -23,21 +23,33 @@ THE SOFTWARE. ...@@ -23,21 +23,33 @@ THE SOFTWARE.
--> -->
<?jelly escape-by-default='true'?> <?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"> <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}"> <tr>
<f:entry title="${%title(descriptor.displayName)}" description="${%description(descriptor.displayName)}"> <td colspan="3"> <!-- f:advanced does not work well here because of placement in third column -->
<f:repeatable name="tool" var="instance" items="${descriptor.installations}" <st:adjunct includes="lib.form.advanced.advanced"/>
add="${%label.add(descriptor.displayName)}" header="${descriptor.displayName}"> <div class="advancedLink" style="text-align:left">
<j:set var="toolDescriptor" value="${descriptor}" /><!-- to make this descriptor accessible from properties --> <input type="button" value="${%title(descriptor.displayName)}..." class="advanced-button advancedButton"/>
<table width="100%"> </div>
<st:include page="config.jelly" from="${descriptor}" class="${descriptor.clazz}"/> <table class="advancedBody">
<f:descriptorList descriptors="${descriptor.propertyDescriptors}" field="properties"/> <tbody>
<f:entry title=""> <f:section title="${descriptor.displayName}">
<div align="right"> <f:entry title="${%title(descriptor.displayName)}" description="${%description(descriptor.displayName)}">
<f:repeatableDeleteButton value="${%label.delete(descriptor.displayName)}"/> <f:repeatable name="tool" var="instance" items="${descriptor.installations}"
</div> add="${%label.add(descriptor.displayName)}" header="${descriptor.displayName}">
</f:entry> <j:set var="toolDescriptor" value="${descriptor}" /><!-- to make this descriptor accessible from properties -->
</table> <table width="100%">
</f:repeatable> <st:include page="config.jelly" from="${descriptor}" class="${descriptor.clazz}"/>
</f:entry> <f:descriptorList descriptors="${descriptor.propertyDescriptors}" field="properties"/>
</f:section> <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> </j:jelly>
...@@ -56,26 +56,7 @@ THE SOFTWARE. ...@@ -56,26 +56,7 @@ THE SOFTWARE.
<j:forEach var="descriptor" items="${h.getSortedDescriptorsForGlobalConfig()}"> <j:forEach var="descriptor" items="${h.getSortedDescriptorsForGlobalConfig()}">
<j:set var="instance" value="${descriptor}" /><!-- this makes the <f:textbox field=.../> work --> <j:set var="instance" value="${descriptor}" /><!-- this makes the <f:textbox field=.../> work -->
<f:rowSet name="${descriptor.jsonSafeClassName}"> <f:rowSet name="${descriptor.jsonSafeClassName}">
<j:choose> <st:include page="${descriptor.globalConfigPage}" from="${descriptor}" />
<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>
</f:rowSet> </f:rowSet>
</j:forEach> </j:forEach>
......
...@@ -28,4 +28,3 @@ statsBlurb=\ ...@@ -28,4 +28,3 @@ statsBlurb=\
Help make Jenkins better by sending anonymous usage statistics and crash reports to the Jenkins project. 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> 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.
先完成此消息的编辑!
想要评论请 注册