File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\ui-samples-plugin\src\main\java\jenkins\plugins\ui_samples\Root.java.html

1 package jenkins.plugins.ui_samples;
2
3 import hudson.Extension;
4 import hudson.model.RootAction;
5 import jenkins.model.ModelObjectWithContextMenu;
6 import org.kohsuke.stapler.StaplerRequest;
7 import org.kohsuke.stapler.StaplerResponse;
8
9 import java.util.List;
10
11 /**
12 * Entry point to all the UI samples.
13 *
14 * @author Kohsuke Kawaguchi
15 */
16 @Extension
17 public class Root implements RootAction, ModelObjectWithContextMenu {
18 public String getIconFileName() {
19 return "gear.png";
20 }
21
22 public String getDisplayName() {
23 return "UI Samples";
24 }
25
26 public String getUrlName() {
27 return "ui-samples";
28 }
29
30 public UISample getDynamic(String name) {
31 for (UISample ui : getAll())
32 if (ui.getUrlName().equals(name))
33 return ui;
34 return null;
35 }
36
37 public List<UISample> getAll() {
38 return UISample.all();
39 }
40
41 public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws Exception {
42 return new ContextMenu().addAll(getAll());
43 }
44 }
45