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

1 package jenkins.model;
2
3 import hudson.Extension;
4 import hudson.ExtensionList;
5 import hudson.ExtensionPoint;
6 import hudson.model.ModelObject;
7 import hudson.security.*;
8 import hudson.security.Messages;
9
10 /**
11 * Grouping of related {@link GlobalConfiguration}s.
12 *
13 * <p>
14 * To facilitate the separation of the global configuration into multiple pages, tabs, and so on,
15 * {@link GlobalConfiguration}s are classified into categories (such as "security", "tools", as well
16 * as the catch all "unclassified".) Categories themselves are extensible &mdash; plugins may introduce
17 * its own category as well, although that should only happen if you are creating a big enough subsystem.
18 *
19 * <p>
20 * The primary purpose of this is to enable future UIs to split the global configurations to
21 * smaller pieces that can be individually looked at and updated.
22 *
23 * @author Kohsuke Kawaguchi
24 * @since 1.494
25 * @see GlobalConfiguration
26 */
27 public abstract class GlobalConfigurationCategory implements ExtensionPoint, ModelObject {
28 /**
29 * One-line plain text message that explains what this category is about.
30 * This can be used in the UI to help the user pick the right category.
31 *
32 * The text should be longer than {@link #getDisplayName()}
33 */
34 public abstract String getShortDescription();
35
36 /**
37 * Returns all the registered {@link GlobalConfiguration} descriptors.
38 */
39 public static ExtensionList<GlobalConfigurationCategory> all() {
40 return Jenkins.getInstance().getExtensionList(GlobalConfigurationCategory.class);
41 }
42
43 public static <T extends GlobalConfigurationCategory> T get(Class<T> type) {
44 return all().get(type);
45 }
46
47 /**
48 * This category represents the catch-all I-dont-know-what-category-it-is instance,
49 * used for those {@link GlobalConfiguration}s that don't really deserve/need a separate
50 * category.
51 *
52 * Also used for backward compatibility. All {@link GlobalConfiguration}s without
53 * explicit category gets this as the category.
54 *
55 * In the current UI, this corresponds to the /configure link.
56 */
57 @Extension
58 public static class Unclassified extends GlobalConfigurationCategory {
59 @Override
60 public String getShortDescription() {
61 return jenkins.management.Messages.ConfigureLink_Description();
62 }
63
64 public String getDisplayName() {
65 return jenkins.management.Messages.ConfigureLink_DisplayName();
66 }
67 }
68
69 /**
70 * Security related configurations.
71 */
72 @Extension
73 public static class Security extends GlobalConfigurationCategory {
74 @Override
75 public String getShortDescription() {
76 return Messages.GlobalSecurityConfiguration_Description();
77 }
78
79 public String getDisplayName() {
80 return hudson.security.Messages.GlobalSecurityConfiguration_DisplayName();
81 }
82 }
83 }
84