1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package fr.paris.lutece.portal.util.mvc.utils;
35
36 import fr.paris.lutece.portal.service.i18n.I18nService;
37
38 import java.util.Locale;
39
40
41
42
43
44 public class MVCMessageBox
45 {
46 public static final int INFO = 0;
47 public static final int QUESTION = 1;
48 public static final int WARNING = 2;
49 public static final int ERROR = 3;
50 private int _nStyle;
51 private String _strTitle;
52 private String _strMessage;
53 private String _strLabelButton1;
54 private String _strUrlButton1;
55 private String _strLabelKeyButton1;
56 private String _strLabelButton2;
57 private String _strUrlButton2;
58 private String _strLabelKeyButton2;
59 private String _strTemplate;
60 private String _strTitleKey;
61 private String _strMessageKey;
62
63
64
65
66 public int getStyle( )
67 {
68 return _nStyle;
69 }
70
71
72
73
74 public void setStyle( int nStyle )
75 {
76 _nStyle = nStyle;
77 }
78
79
80
81
82 public String getTitle( )
83 {
84 return _strTitle;
85 }
86
87
88
89
90 public void setTitle( String strTitle )
91 {
92 _strTitle = strTitle;
93 }
94
95
96
97
98 public String getMessage( )
99 {
100 return _strMessage;
101 }
102
103
104
105
106 public void setMessage( String strMessage )
107 {
108 _strMessage = strMessage;
109 }
110
111
112
113
114 public String getLabelButton1( )
115 {
116 return _strLabelButton1;
117 }
118
119
120
121
122 public void setLabelButton1( String strLabelButton1 )
123 {
124 _strLabelButton1 = strLabelButton1;
125 }
126
127
128
129
130 public String getUrlButton1( )
131 {
132 return _strUrlButton1;
133 }
134
135
136
137
138 public void setUrlButton1( String strUrlButton1 )
139 {
140 _strUrlButton1 = strUrlButton1;
141 }
142
143
144
145
146 public String getLabelButton2( )
147 {
148 return _strLabelButton2;
149 }
150
151
152
153
154 public void setLabelButton2( String strLabelButton2 )
155 {
156 _strLabelButton2 = strLabelButton2;
157 }
158
159
160
161
162 public String getUrlButton2( )
163 {
164 return _strUrlButton2;
165 }
166
167
168
169
170 public void setUrlButton2( String strUrlButton2 )
171 {
172 _strUrlButton2 = strUrlButton2;
173 }
174
175
176
177
178 public String getLabelKeyButton1( )
179 {
180 return _strLabelKeyButton1;
181 }
182
183
184
185
186 public void setLabelKeyButton1( String strLabelKeyButton1 )
187 {
188 _strLabelKeyButton1 = strLabelKeyButton1;
189 }
190
191
192
193
194 public String getLabelKeyButton2( )
195 {
196 return _strLabelKeyButton2;
197 }
198
199
200
201
202 public void setLabelKeyButton2( String strLabelKeyButton2 )
203 {
204 _strLabelKeyButton2 = strLabelKeyButton2;
205 }
206
207
208
209
210 public String getTemplate( )
211 {
212 return _strTemplate;
213 }
214
215
216
217
218 public void setTemplate( String strTemplate )
219 {
220 _strTemplate = strTemplate;
221 }
222
223
224
225
226 public String getTitleKey( )
227 {
228 return _strTitleKey;
229 }
230
231
232
233
234 public void setTitleKey( String strTitleKey )
235 {
236 this._strTitleKey = strTitleKey;
237 }
238
239
240
241
242 public String getMessageKey( )
243 {
244 return _strMessageKey;
245 }
246
247
248
249
250 public void setMessageKey( String strMessageKey )
251 {
252 this._strMessageKey = strMessageKey;
253 }
254
255
256
257
258
259 public void localize( Locale locale )
260 {
261 _strTitle = ( _strTitleKey != null ) ? I18nService.getLocalizedString( _strTitleKey, locale ) : _strTitle;
262 _strMessage = ( _strMessageKey != null ) ? I18nService.getLocalizedString( _strMessageKey, locale ) : _strMessage;
263 _strLabelButton1 = ( _strLabelKeyButton1 != null )
264 ? I18nService.getLocalizedString( _strLabelKeyButton1, locale ) : _strLabelButton1;
265 _strLabelButton2 = ( _strLabelKeyButton2 != null )
266 ? I18nService.getLocalizedString( _strLabelKeyButton2, locale ) : _strLabelButton2;
267 }
268 }