KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > model > TopLevelItemDescriptor


1 package hudson.model;
2
3 import org.kohsuke.stapler.StaplerRequest;
4
5 import java.util.List JavaDoc;
6 import java.util.ArrayList JavaDoc;
7
8 /**
9  * {@link Descriptor} for {@link TopLevelItem}s.
10  *
11  * @author Kohsuke Kawaguchi
12  */

13 public abstract class TopLevelItemDescriptor extends Descriptor<TopLevelItem> {
14     protected TopLevelItemDescriptor(Class JavaDoc<? extends TopLevelItem> clazz) {
15         super(clazz);
16     }
17
18     /**
19      * {@inheritDoc}
20      *
21      * <p>
22      * Used as the caption when the user chooses what job type to create.
23      * The descriptor implementation also needs to have <tt>detail.jelly</tt>
24      * script, which will be used to render the text below the caption
25      * that expains the job type.
26      */

27     public abstract String JavaDoc getDisplayName();
28
29     public final String JavaDoc getNewJobDetailPage() {
30         return '/'+clazz.getName().replace('.','/').replace('$','/')+"/newJobDetail.jelly";
31     }
32
33     /**
34      * @deprecated
35      * This is not a valid operation for {@link Job}s.
36      */

37     @Deprecated JavaDoc
38     public TopLevelItem newInstance(StaplerRequest req) throws FormException {
39         throw new UnsupportedOperationException JavaDoc();
40     }
41
42     /**
43      * Creates a new {@link Job}.
44      */

45     public abstract TopLevelItem newInstance(String JavaDoc name);
46 }
47
Popular Tags