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

1 package hudson.model;
2
3 import jenkins.model.Jenkins;
4 import org.jvnet.localizer.LocaleProvider;
5 import org.jvnet.localizer.Localizable;
6 import org.kohsuke.stapler.Stapler;
7
8 /**
9 * {@link StatusIcon} for stock icon in Hudson.
10 *
11 * @author Kohsuke Kawaguchi
12 * @since 1.390.
13 */
14 public final class StockStatusIcon extends AbstractStatusIcon {
15 private final Localizable description;
16 private final String image;
17
18 /**
19 * @param image
20 * Short file name like "folder.gif" that points to a stock icon in Hudson.
21 * @param description
22 * Used as {@link #getDescription()}.
23 */
24 public StockStatusIcon(String image, Localizable description) {
25 this.image = image;
26 this.description = description;
27 }
28
29 public String getImageOf(String size) {
30 return Stapler.getCurrentRequest().getContextPath()+ Jenkins.RESOURCE_PATH+"/images/"+size+'/'+image;
31 }
32
33 public String getDescription() {
34 return description.toString(LocaleProvider.getLocale());
35 }
36 }
37