1
2
3
4
5 package org.directdemocracyportal.democracy.web.views.header;
6
7 import org.directdemocracyportal.democracy.web.ApplicationMessageHolder;
8 import org.directdemocracyportal.democracy.web.BeanLocator;
9 import org.directdemocracyportal.democracy.web.ApplicationMessageHolder.MessageConstans;
10 import org.directdemocracyportal.democracy.web.action.LoginAction;
11 import org.directdemocracyportal.democracy.web.action.RegisterAction;
12
13 import thinwire.ui.Button;
14 import thinwire.ui.Panel;
15 import thinwire.ui.layout.TableLayout;
16 import thinwire.ui.style.Color;
17
18 /***
19 * The Class WelcomePanel.
20 */
21 public class WelcomePanel extends Panel
22 {
23
24 /***
25 * Instantiates a new welcome panel.
26 */
27 public WelcomePanel() {
28 super();
29 getStyle().getBackground().setColor(Color.valueOf("rgb(0,51,153)"));
30 setLayout(new TableLayout(new double[][] { { 0, 0 },
31 { 0 } },
32 1,
33 5));
34
35 Button registerButton = new Button();
36 registerButton.setText(ApplicationMessageHolder
37 .getMessage(MessageConstans.BUTTON_REGISTER));
38 registerButton.setUserObject(new RegisterAction());
39 registerButton.addActionListener(ACTION_CLICK, BeanLocator
40 .getApplicationActionListener());
41 registerButton.setSize(90, 30);
42 registerButton.setLimit("0,0,c,c");
43 getChildren().add(registerButton);
44
45 Button loginButton = new Button();
46 loginButton.setText(ApplicationMessageHolder
47 .getMessage(MessageConstans.BUTTON_LOGIN));
48 loginButton.setUserObject(new LoginAction());
49 loginButton.addActionListener(ACTION_CLICK, BeanLocator
50 .getApplicationActionListener());
51 loginButton.setSize(90, 30);
52 loginButton.setLimit("1,0,c,c");
53 getChildren().add(loginButton);
54 }
55 }