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

1 package hudson.model;
2
3 import hudson.ExtensionList;
4 import hudson.ExtensionPoint;
5 import jenkins.model.Jenkins;
6
7 import java.util.ArrayList;
8 import java.util.List;
9
10 /**
11 * Extension point for adding transient {@link Action}s to {@link View}s.
12 *
13 * @since 1.388
14 */
15 public abstract class TransientViewActionFactory implements ExtensionPoint {
16
17 /**
18 * returns a list of (transient) actions never null, may be empty
19 *
20 * @param v
21 * @return
22 */
23 public abstract List<Action> createFor(View v);
24
25 /**
26 * Returns all the registered {@link TransientViewActionFactory}s.
27 */
28 public static ExtensionList<TransientViewActionFactory> all() {
29 return Jenkins.getInstance().getExtensionList(TransientViewActionFactory.class);
30 }
31
32 /**
33 * Creates {@link Action)s for a view, using all registered {@link TransientViewActionFactory}s.
34 */
35 public static List<Action> createAllFor(View v) {
36 List<Action> result = new ArrayList<Action>();
37 for (TransientViewActionFactory f: all()) {
38 result.addAll(f.createFor(v));
39 }
40 return result;
41 }
42
43 }
44