| 167 |
ashish |
1 |
package in.shop2020.hotspot.dashbaord.client;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.hotspot.dashbaord.client.LoginDisplayPresenter.Display;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.event.dom.client.HasClickHandlers;
|
|
|
6 |
import com.google.gwt.user.client.ui.Button;
|
|
|
7 |
import com.google.gwt.user.client.ui.Composite;
|
|
|
8 |
import com.google.gwt.user.client.ui.HasText;
|
|
|
9 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
10 |
import com.google.gwt.user.client.ui.Label;
|
| 493 |
rajveer |
11 |
import com.google.gwt.user.client.ui.PasswordTextBox;
|
| 167 |
ashish |
12 |
import com.google.gwt.user.client.ui.TextBox;
|
|
|
13 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
14 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
15 |
|
|
|
16 |
public class LoginDisplayWidget extends Composite implements Display{
|
|
|
17 |
|
|
|
18 |
private Label errLabel = new Label("");
|
|
|
19 |
private Label headerMessage = new Label("Please key in your credentials");
|
|
|
20 |
private Label userLabel = new Label("Username");
|
|
|
21 |
private Label passwordLabel = new Label("Password");
|
|
|
22 |
private TextBox userTextBox = new TextBox();
|
| 493 |
rajveer |
23 |
private PasswordTextBox passwordTextBox = new PasswordTextBox();
|
| 167 |
ashish |
24 |
private Button submitButton = new Button("Login");
|
|
|
25 |
|
| 306 |
ashish |
26 |
|
| 167 |
ashish |
27 |
public LoginDisplayWidget(){
|
|
|
28 |
|
|
|
29 |
//errLabel.setVisible(false);
|
|
|
30 |
VerticalPanel vertPanel = new VerticalPanel();
|
| 306 |
ashish |
31 |
vertPanel.setSpacing(5);
|
| 167 |
ashish |
32 |
HorizontalPanel horizontalPanel = new HorizontalPanel();
|
| 306 |
ashish |
33 |
horizontalPanel.setSpacing(5);
|
| 167 |
ashish |
34 |
vertPanel.add(headerMessage);
|
|
|
35 |
vertPanel.add(errLabel);
|
|
|
36 |
vertPanel.add(horizontalPanel);
|
|
|
37 |
horizontalPanel.add(userLabel);
|
|
|
38 |
horizontalPanel.add(userTextBox);
|
| 306 |
ashish |
39 |
horizontalPanel.setCellWidth(horizontalPanel.getWidget(0), "128px");
|
|
|
40 |
horizontalPanel.setCellWidth(horizontalPanel.getWidget(1), "128px");
|
|
|
41 |
vertPanel.setCellHeight(vertPanel.getWidget(0), "10px");
|
|
|
42 |
vertPanel.setCellHeight(vertPanel.getWidget(1), "10px");
|
|
|
43 |
vertPanel.setCellHeight(vertPanel.getWidget(2), "10px");
|
| 167 |
ashish |
44 |
horizontalPanel = new HorizontalPanel();
|
| 306 |
ashish |
45 |
horizontalPanel.setSpacing(5);
|
| 167 |
ashish |
46 |
vertPanel.add(horizontalPanel);
|
|
|
47 |
horizontalPanel.add(passwordLabel);
|
|
|
48 |
horizontalPanel.add(passwordTextBox);
|
| 306 |
ashish |
49 |
horizontalPanel.setCellWidth(horizontalPanel.getWidget(0), "128px");
|
|
|
50 |
horizontalPanel.setCellWidth(horizontalPanel.getWidget(1), "128px");
|
|
|
51 |
vertPanel.setCellHeight(vertPanel.getWidget(3), "10px");
|
| 167 |
ashish |
52 |
vertPanel.add(submitButton);
|
| 306 |
ashish |
53 |
vertPanel.setStyleName("centerBox");
|
| 167 |
ashish |
54 |
initWidget(vertPanel);
|
|
|
55 |
}
|
|
|
56 |
@Override
|
|
|
57 |
public HasText getLoginName() {
|
|
|
58 |
// TODO Auto-generated method stub
|
|
|
59 |
return userTextBox;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
@Override
|
|
|
63 |
public HasText getMessage() {
|
|
|
64 |
// TODO Auto-generated method stub
|
|
|
65 |
return errLabel;
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
@Override
|
|
|
69 |
public HasText getPassword() {
|
|
|
70 |
// TODO Auto-generated method stub
|
|
|
71 |
return passwordTextBox;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
@Override
|
|
|
75 |
public HasClickHandlers getSubmit() {
|
|
|
76 |
// TODO Auto-generated method stub
|
|
|
77 |
return submitButton;
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
@Override
|
|
|
81 |
public Widget asWidget() {
|
|
|
82 |
// TODO Auto-generated method stub
|
|
|
83 |
return this;
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
}
|