Merge pull request #4586 from daniel-beck/manage-context-menu-titles

Add section titles to Manage Jenkins context menu
This commit is contained in:
Tim Jacomb authored and GitHub committed 2020-04-12 10:12:44 +01:00
commit 9bb02ecfa3
4 files changed
+32 -2

No files matched your search

@@ -14,6 +14,8 @@ import org.apache.commons.jelly.JellyException;
import org.apache.commons.jelly.JellyTagException;
import org.apache.commons.jelly.Script;
import org.apache.commons.jelly.XMLOutput;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
@@ -128,6 +130,18 @@ public interface ModelObjectWithContextMenu extends ModelObject {
return this;
}
/**
* Add a header row (no icon, no URL, rendered in header style).
*
* @since TODO
*/
@Restricted(DoNotUse.class) // manage.jelly only
public ContextMenu addHeader(String title) {
final MenuItem item = new MenuItem().withDisplayName(title);
item.header = true;
return add(item);
}
/**
* Adds a manually constructed {@link MenuItem}
*
@@ -259,6 +273,13 @@ public interface ModelObjectWithContextMenu extends ModelObject {
*/
@Exported public boolean requiresConfirmation;
/**
* True to display this item as a section header.
* @since TODO
*/
@Exported public boolean header;
/**
* If this is a submenu, definition of subitems.
*/