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.
Via
HttpResponse
, this class is capable of converting itself to JSON that <l:breadcrumb/>
understands.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe actual contents of the menu. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a computerAdds a child item when rendering context menu of its parent.Adds a nodeadd
(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation) add
(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation, Badge badge) add
(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation, Badge badge, String message) Adds a manually constructedModelObjectWithContextMenu.MenuItem
addAll
(Collection<? extends Action> actions) Add a header row (no icon, no URL, rendered in header style).Add a separator row (no icon, no URL, no text).from
(ModelObjectWithContextMenu self, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) Default implementation of the context menu generation.from
(ModelObjectWithContextMenu self, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, String view) void
generateResponse
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, Object o)
-
Field Details
-
items
The actual contents of the menu.
-
-
Constructor Details
-
ContextMenu
public ContextMenu()
-
-
Method Details
-
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
-
addAll
-
add
-
add
-
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
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation, Badge badge) - Since:
- 2.401
-
add
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation, Badge badge, String message) - Since:
- 2.415
-
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
Add a separator row (no icon, no URL, no text).- Since:
- 2.340
-
add
Adds a manually constructedModelObjectWithContextMenu.MenuItem
- Since:
- 1.513
-
add
Adds a node- Since:
- 1.513
-
add
Adds a computer- Since:
- 1.513
-
add
-
add
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
-