@ExportedBean public static class ModelObjectWithContextMenu.ContextMenu extends Object implements org.kohsuke.stapler.HttpResponse
HttpResponse, this class is capable of converting itself to JSON that <l:breadcrumb/> understands.| Modifier and Type | Field and Description |
|---|---|
List<ModelObjectWithContextMenu.MenuItem> |
items
The actual contents of the menu.
|
| Constructor and Description |
|---|
ContextMenu() |
@Exported(inline=true) public final List<ModelObjectWithContextMenu.MenuItem> items
public void generateResponse(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
Object o)
throws IOException,
javax.servlet.ServletException
generateResponse in interface org.kohsuke.stapler.HttpResponseIOExceptionjavax.servlet.ServletExceptionpublic ModelObjectWithContextMenu.ContextMenu add(String url, String text)
public ModelObjectWithContextMenu.ContextMenu addAll(Collection<? extends Action> actions)
public ModelObjectWithContextMenu.ContextMenu add(Action a)
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String text)
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String text, boolean post)
public ModelObjectWithContextMenu.ContextMenu add(String url, String icon, String text, boolean post, boolean requiresConfirmation)
public ModelObjectWithContextMenu.ContextMenu add(ModelObjectWithContextMenu.MenuItem item)
ModelObjectWithContextMenu.MenuItempublic ModelObjectWithContextMenu.ContextMenu add(Node n)
public ModelObjectWithContextMenu.ContextMenu add(Computer c)
public ModelObjectWithContextMenu.ContextMenu add(Job job)
public ModelObjectWithContextMenu.ContextMenu from(ModelObjectWithContextMenu self, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws org.apache.commons.jelly.JellyException, IOException
This method uses sidepanel.groovy to run the side panel generation, captures
the use of <l:task> tags, and then converts those into ModelObjectWithContextMenu.MenuItems. This is
supposed to make this work with most existing ModelObjects that follow the standard
convention.
Unconventional ModelObject implementations that do not use sidepanel.groovy
can override ModelObjectWithContextMenu.doContextMenu(StaplerRequest, StaplerResponse)
directly to provide alternative semantics.
org.apache.commons.jelly.JellyExceptionIOExceptionpublic ModelObjectWithContextMenu.ContextMenu from(ModelObjectWithContextMenu self, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, String view) throws org.apache.commons.jelly.JellyException, IOException
org.apache.commons.jelly.JellyExceptionIOExceptionCopyright © 2019. All rights reserved.