Skip to content
Permalink
Browse files

Merge pull request #17 from yoichi/JENKINS-19698

[FIXED JENKINS-19698] add context menu on breadcrumb list
  • Loading branch information
ctapobep committed Nov 23, 2013
2 parents 1be9638 + 2e4d068 commit 455e74db34782b8f7fd45ab49cff65df394d7252
Showing with 15 additions and 1 deletion.
  1. +15 −1 src/main/java/hudson/plugins/nested_view/NestedView.java
@@ -32,6 +32,8 @@
import hudson.util.FormValidation;
import hudson.views.ListViewColumn;
import hudson.views.ViewsTabBar;
import jenkins.model.ModelObjectWithContextMenu;
import org.apache.commons.jelly.JellyException;
import org.kohsuke.stapler.*;
import org.kohsuke.stapler.export.Exported;

@@ -50,7 +52,7 @@
* @author Kohsuke Kawaguchi
* @author Romain Seguy
*/
public class NestedView extends View implements ViewGroup, StaplerProxy {
public class NestedView extends View implements ViewGroup, StaplerProxy, ModelObjectWithContextMenu {
private final static Result WORST_RESULT = Result.FAILURE;

/**
@@ -77,6 +79,18 @@ public boolean contains(TopLevelItem item) {
return false;
}

public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws IOException, JellyException {
return new ContextMenu().from(this, request, response);
}

public ContextMenu doChildrenContextMenu(StaplerRequest request, StaplerResponse response) throws Exception {
ContextMenu menu = new ContextMenu();
for (View view : getViews()) {
menu.add(new MenuItem().withContextRelativeUrl(view.getUrl()).withDisplayName(view.getDisplayName()));
}
return menu;
}

@Override
public String getUrl() {
return getViewUrl();

0 comments on commit 455e74d

Please sign in to comment.
You can’t perform that action at this time.