@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.HttpResponse
IOException
javax.servlet.ServletException
public 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)
@Restricted(value=org.kohsuke.accmod.restrictions.DoNotUse.class) public ModelObjectWithContextMenu.ContextMenu addHeader(String title)
public ModelObjectWithContextMenu.ContextMenu add(ModelObjectWithContextMenu.MenuItem item)
ModelObjectWithContextMenu.MenuItem
public 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.MenuItem
s. This is
supposed to make this work with most existing ModelObject
s 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.JellyException
IOException
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
org.apache.commons.jelly.JellyException
IOException
Copyright © 2004–2021. All rights reserved.