提交 5007d000 编写于 作者: K kohsuke

support conditional ManagementLink objects

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9964 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1f3b1e8a
...@@ -28,6 +28,11 @@ public abstract class ManagementLink implements ExtensionPoint, Action { ...@@ -28,6 +28,11 @@ public abstract class ManagementLink implements ExtensionPoint, Action {
* Mostly works like {@link Action#getIconFileName()}, except that * Mostly works like {@link Action#getIconFileName()}, except that
* the expected icon size is 48x48, not 24x24. So if you give * the expected icon size is 48x48, not 24x24. So if you give
* just a file name, "/images/48x48" will be assumed. * just a file name, "/images/48x48" will be assumed.
*
* @return
* As a special case, return null to exclude this object from the management link.
* This is useful for defining {@link ManagementLink} that only shows up under
* certain circumstances.
*/ */
public abstract String getIconFileName(); public abstract String getIconFileName();
......
...@@ -52,9 +52,11 @@ ...@@ -52,9 +52,11 @@
</j:if> </j:if>
<!-- TODO: replace all the hard-coded ones with the standard extension point --> <!-- TODO: replace all the hard-coded ones with the standard extension point -->
<j:forEach var="m" items="${it.managementLinks}"> <j:forEach var="m" items="${it.managementLinks}">
<local:feature icon="${m.iconFileName}" href="${m.urlName}" title="${m.displayName}"> <j:if test="${m.iconFileName!=null}">
${m.description} <local:feature icon="${m.iconFileName}" href="${m.urlName}" title="${m.displayName}">
</local:feature> ${m.description}
</local:feature>
</j:if>
</j:forEach> </j:forEach>
<j:choose> <j:choose>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册