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 public class MVCMessageBox
44 {
45 public static final int INFO = 0;
46 public static final int QUESTION = 1;
47 public static final int WARNING = 2;
48 public static final int ERROR = 3;
49 private int _nStyle;
50 private String _strTitle;
51 private String _strMessage;
52 private String _strLabelButton1;
53 private String _strUrlButton1;
54 private String _strLabelKeyButton1;
55 private String _strLabelButton2;
56 private String _strUrlButton2;
57 private String _strLabelKeyButton2;
58 private String _strTemplate;
59 private String _strTitleKey;
60 private String _strMessageKey;
61
62
63
64
65 public int getStyle( )
66 {
67 return _nStyle;
68 }
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
91 public void setTitle( String strTitle )
92 {
93 _strTitle = strTitle;
94 }
95
96
97
98
99 public String getMessage( )
100 {
101 return _strMessage;
102 }
103
104
105
106
107
108 public void setMessage( String strMessage )
109 {
110 _strMessage = strMessage;
111 }
112
113
114
115
116 public String getLabelButton1( )
117 {
118 return _strLabelButton1;
119 }
120
121
122
123
124
125 public void setLabelButton1( String strLabelButton1 )
126 {
127 _strLabelButton1 = strLabelButton1;
128 }
129
130
131
132
133 public String getUrlButton1( )
134 {
135 return _strUrlButton1;
136 }
137
138
139
140
141
142 public void setUrlButton1( String strUrlButton1 )
143 {
144 _strUrlButton1 = strUrlButton1;
145 }
146
147
148
149
150 public String getLabelButton2( )
151 {
152 return _strLabelButton2;
153 }
154
155
156
157
158
159 public void setLabelButton2( String strLabelButton2 )
160 {
161 _strLabelButton2 = strLabelButton2;
162 }
163
164
165
166
167 public String getUrlButton2( )
168 {
169 return _strUrlButton2;
170 }
171
172
173
174
175
176 public void setUrlButton2( String strUrlButton2 )
177 {
178 _strUrlButton2 = strUrlButton2;
179 }
180
181
182
183
184 public String getLabelKeyButton1( )
185 {
186 return _strLabelKeyButton1;
187 }
188
189
190
191
192
193 public void setLabelKeyButton1( String strLabelKeyButton1 )
194 {
195 _strLabelKeyButton1 = strLabelKeyButton1;
196 }
197
198
199
200
201 public String getLabelKeyButton2( )
202 {
203 return _strLabelKeyButton2;
204 }
205
206
207
208
209
210 public void setLabelKeyButton2( String strLabelKeyButton2 )
211 {
212 _strLabelKeyButton2 = strLabelKeyButton2;
213 }
214
215
216
217
218 public String getTemplate( )
219 {
220 return _strTemplate;
221 }
222
223
224
225
226
227 public void setTemplate( String strTemplate )
228 {
229 _strTemplate = strTemplate;
230 }
231
232
233
234
235 public String getTitleKey( )
236 {
237 return _strTitleKey;
238 }
239
240
241
242
243
244 public void setTitleKey( String strTitleKey )
245 {
246 this._strTitleKey = strTitleKey;
247 }
248
249
250
251
252 public String getMessageKey( )
253 {
254 return _strMessageKey;
255 }
256
257
258
259
260
261 public void setMessageKey( String strMessageKey )
262 {
263 this._strMessageKey = strMessageKey;
264 }
265
266
267
268
269
270
271
272 public void localize( Locale locale )
273 {
274 _strTitle = ( _strTitleKey != null ) ? I18nService.getLocalizedString( _strTitleKey, locale ) : _strTitle;
275 _strMessage = ( _strMessageKey != null ) ? I18nService.getLocalizedString( _strMessageKey, locale ) : _strMessage;
276 _strLabelButton1 = ( _strLabelKeyButton1 != null ) ? I18nService.getLocalizedString( _strLabelKeyButton1, locale ) : _strLabelButton1;
277 _strLabelButton2 = ( _strLabelKeyButton2 != null ) ? I18nService.getLocalizedString( _strLabelKeyButton2, locale ) : _strLabelButton2;
278 }
279 }