Package jenkins.model
Class ModelObjectWithContextMenu.ContextMenu
- java.lang.Object
-
- jenkins.model.ModelObjectWithContextMenu.ContextMenu
-
- All Implemented Interfaces:
org.kohsuke.stapler.HttpResponse
- Enclosing interface:
- ModelObjectWithContextMenu
@ExportedBean public static class ModelObjectWithContextMenu.ContextMenu extends Object implements org.kohsuke.stapler.HttpResponse
Data object that represents the context menu. ViaHttpResponse
, this class is capable of converting itself to JSON that<l:breadcrumb/>
understands.
-
-
Field Summary
Fields Modifier and Type Field Description List<ModelObjectWithContextMenu.MenuItem>
items
The actual contents of the menu.
-
Constructor Summary
Constructors Constructor Description ContextMenu()
-
Method Summary
-
-
-
Field Detail
-
items
@Exported(inline=true) public final List<ModelObjectWithContextMenu.MenuItem> items
The actual contents of the menu.
-
-
Method Detail
-
generateResponse
public void generateResponse(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, Object o) throws IOException, javax.servlet.ServletException
- Specified by:
generateResponse
in interfaceorg.kohsuke.stapler.HttpResponse
- Throws:
IOException
javax.servlet.ServletException
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String text)
-
addAll
public ModelObjectWithContextMenu.ContextMenu addAll(Collection<? extends Action> actions)
-
add
public ModelObjectWithContextMenu.ContextMenu add(Action a)
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String text)
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String text, boolean post)
- Since:
- 1.504
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String text, boolean post, boolean requiresConfirmation)
- Since:
- 1.512
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation)
- Since:
- 2.335
-
addHeader
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public ModelObjectWithContextMenu.ContextMenu addHeader(String title)
Add a header row (no icon, no URL, rendered in header style).- Since:
- 2.231
-
addSeparator
public ModelObjectWithContextMenu.ContextMenu addSeparator()
Add a separator row (no icon, no URL, no text).- Since:
- 2.340
-
add
public ModelObjectWithContextMenu.ContextMenu add(ModelObjectWithContextMenu.MenuItem item)
Adds a manually constructedModelObjectWithContextMenu.MenuItem
- Since:
- 1.513
-
add
public ModelObjectWithContextMenu.ContextMenu add(Node n)
Adds a node- Since:
- 1.513
-
add
public ModelObjectWithContextMenu.ContextMenu add(Computer c)
Adds a computer- Since:
- 1.513
-
add
public ModelObjectWithContextMenu.ContextMenu add(Job job)
Adds a child item when rendering context menu of its parent.- Since:
- 1.513
-
from
public ModelObjectWithContextMenu.ContextMenu from(ModelObjectWithContextMenu self, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws org.apache.commons.jelly.JellyException, IOException
Default implementation of the context menu generation.This method uses
sidepanel.groovy
to run the side panel generation, captures the use of<l:task>
tags, and then converts those intoModelObjectWithContextMenu.MenuItem
s. This is supposed to make this work with most existingModelObject
s that follow the standard convention.Unconventional
ModelObject
implementations that do not usesidepanel.groovy
can overrideModelObjectWithContextMenu.doContextMenu(StaplerRequest, StaplerResponse)
directly to provide alternative semantics.- Throws:
org.apache.commons.jelly.JellyException
IOException
-
from
public ModelObjectWithContextMenu.ContextMenu from(ModelObjectWithContextMenu self, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, String view) throws org.apache.commons.jelly.JellyException, IOException
- Throws:
org.apache.commons.jelly.JellyException
IOException
-
-