提交 02031a91 编写于 作者: K Kohsuke Kawaguchi

added an extension point to modularize the system configuration page.

上级 027a708f
package jenkins.model;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.Descriptor;
/**
* Convenient base class for extensions that contributes to the system configuration page but nothing else.
*
* <p>
* All {@link Descriptor}s are capable of contributing fragment to the system config page, so
* this extension point is is really only for those who don't want to contribute anything else.
*
* @author Kohsuke Kawaguchi
* @since 1.425
*/
public abstract class GlobalConfiguration extends Descriptor<GlobalConfiguration> implements ExtensionPoint, Describable<GlobalConfiguration> {
protected GlobalConfiguration() {
super(self());
}
public final Descriptor<GlobalConfiguration> getDescriptor() {
return this;
}
/**
* Unless this object has additional web presence, display name is not used at all.
* So default to "".
*/
public String getDisplayName() {
return "";
}
@Override
public String getGlobalConfigPage() {
return getConfigPage();
}
/**
* Returns all the registered {@link GlobalConfiguration} descriptors.
*/
public static ExtensionList<GlobalConfiguration> all() {
return Jenkins.getInstance().getDescriptorList(GlobalConfiguration.class);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册