1
2
3
4
5 package org.directdemocracyportal.democracy.web.views.dialogs;
6
7 import org.directdemocracyportal.democracy.web.ApplicationMessageHolder;
8 import org.directdemocracyportal.democracy.web.ImageConstants;
9 import org.directdemocracyportal.democracy.web.ApplicationMessageHolder.MessageConstans;
10
11 import thinwire.ui.Image;
12 import thinwire.ui.Label;
13 import thinwire.ui.Panel;
14 import thinwire.ui.layout.TableLayout;
15
16
17 /***
18 * The Class ErrorMessageBox.
19 */
20 public class ErrorMessageBox extends Panel
21 {
22
23 /*** The error message. */
24 private Label errorMessage = new Label();
25
26 /***
27 * Instantiates a new error message box.
28 */
29 public ErrorMessageBox() {
30 super();
31 setVisible(false);
32 setLayout(new TableLayout(new double[][] { {16, 200},
33 { 16 } },
34 2,
35 4));
36
37 Image errorImage = new Image(ImageConstants.ACTION_ERROR);
38 errorImage.setSize(ImageConstants.ICON_SIZE, ImageConstants.ICON_SIZE);
39 errorImage.setLimit("0,0");
40 getChildren().add(errorImage);
41
42 errorMessage.setLimit("1,0");
43 errorMessage.setSize(200, 16);
44 getChildren().add(errorMessage);
45 }
46
47 /***
48 * Display error message.
49 *
50 * @param message the message
51 */
52 public void displayErrorMessage(String message) {
53 errorMessage.setText(" " + ApplicationMessageHolder
54 .getMessage(MessageConstans.ERROR_MESSAGE) + " : " + message);
55 setVisible(true);
56 }
57 }