]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/src/org/splat/simer/StampFacade.java
Salome HOME
Modifications to respect PMD rules.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / StampFacade.java
1 package org.splat.simer;
2
3 /**
4  * 
5  * @author    Daniel Brunier-Coulin
6  * @copyright OPEN CASCADE 2012
7  */
8
9 import java.text.SimpleDateFormat;
10 import java.util.ResourceBundle;
11
12 import org.splat.dal.bo.som.Timestamp;
13 import org.splat.dal.bo.som.ValidationStep;
14
15 public class StampFacade implements HistoryFacade {
16
17         private transient String _icon;
18         private transient final String _comment;
19         private transient final String _date;
20         private transient final String _empty;
21         private transient final String _nonicon;
22
23         // ==============================================================================================================================
24         // Constructor
25         // ==============================================================================================================================
26
27         public StampFacade(final Timestamp stamp) {
28                 ResourceBundle labels = ResourceBundle.getBundle("labels",
29                                 ApplicationSettings.getCurrentLocale());
30                 ResourceBundle custom = ResourceBundle.getBundle("som",
31                                 ApplicationSettings.getCurrentLocale());
32                 SimpleDateFormat convert = new SimpleDateFormat(custom
33                                 .getString("date.format")); // Date display format
34                 ValidationStep type = stamp.getType();
35
36                 _nonicon = "image.hold.gif";
37                 _empty = "";
38                 _date = convert.format(stamp.getDate());
39                 _comment = labels.getString("label." + type.toString()) + " "
40                                 + stamp.getAuthor().toString();
41                 if (type == ValidationStep.APPROVAL) {
42                         _icon = "icon.APPROVED.png";
43                 } else if (type == ValidationStep.REVIEW) {
44                         _icon = "icon.inCHECK.png";
45                 } else if (type == ValidationStep.PROMOTION) {
46                         _icon = "icon.inDRAFT.png";
47                 } else {
48                         _icon = "icon.inWORK.png";
49                 }
50         }
51
52         // ==============================================================================================================================
53         // Getters
54         // ==============================================================================================================================
55
56         public String getDate() {
57                 return _date;
58         }
59
60         public String getDescription() {
61                 return _comment;
62         }
63
64         public String getFileIcon() {
65                 return _icon;
66         }
67
68         public String getSharingIcon() {
69                 return _nonicon;
70         }
71
72         public String getSize() {
73                 return _empty;
74         }
75
76         public String getVersion() {
77                 return _empty;
78         }
79
80         public String getVersioningIcon() {
81                 return _nonicon;
82         }
83 }