File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\model\ManagementLink.java.html

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 */
24 package hudson.model;
25
26 import hudson.ExtensionPoint;
27 import hudson.ExtensionListView;
28 import hudson.Extension;
29 import hudson.ExtensionList;
30 import hudson.security.Permission;
31 import jenkins.model.Jenkins;
32
33 import java.util.List;
34
35 /**
36 * Extension point to add icon to <tt>http://server/hudson/manage</tt> page.
37 *
38 * <p>
39 * This is a place for exposing features that are only meant for system admins
40 * (whereas features that are meant for Hudson users at large should probably
41 * be added to {@link Jenkins#getActions()}.)
42 *
43 * <p>
44 * To register a new instance, put {@link Extension} on your implementation class.
45 *
46 * @author Kohsuke Kawaguchi
47 * @since 1.194
48 */
49 public abstract class ManagementLink implements ExtensionPoint, Action {
50
51 /**
52 * Mostly works like {@link Action#getIconFileName()}, except that
53 * the expected icon size is 48x48, not 24x24. So if you give
54 * just a file name, "/images/48x48" will be assumed.
55 *
56 * @return
57 * As a special case, return null to exclude this object from the management link.
58 * This is useful for defining {@link ManagementLink} that only shows up under
59 * certain circumstances.
60 */
61 public abstract String getIconFileName();
62
63 /**
64 * Returns a short description of what this link does. This text
65 * is the one that's displayed in grey. This can include HTML,
66 * although the use of block tags is highly discouraged.
67 *
68 * Optional.
69 */
70 public String getDescription() {
71 return "";
72 }
73
74 /**
75 * {@inheritDoc}
76 *
77 * <p>
78 * In case of {@link ManagementLink}, this value is put straight into the href attribute,
79 * so relative paths are interpreted against the root {@link Jenkins} object.
80 */
81 public abstract String getUrlName();
82
83 /**
84 * All registered instances.
85 * @deprecated as of 1.286
86 * Use {@link #all()} for read access and put {@link Extension} for registration.
87 */
88 public static final List<ManagementLink> LIST = ExtensionListView.createList(ManagementLink.class);
89
90 /**
91 * All regsitered instances.
92 */
93 public static ExtensionList<ManagementLink> all() {
94 return Jenkins.getInstance().getExtensionList(ManagementLink.class);
95 }
96
97 /**
98 * @return permission required for user to access this management link, in addition to {@link Jenkins.ADMINISTER}
99 */
100 public Permission getRequiredPermission() {
101 return null;
102 }
103 }
104