| 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.HasCaption;
|
|
|
9 |
import com.google.gwt.user.client.ui.HasText;
|
|
|
10 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
11 |
import com.google.gwt.user.client.ui.Label;
|
|
|
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();
|
|
|
23 |
private TextBox passwordTextBox = new TextBox();
|
|
|
24 |
private Button submitButton = new Button("Login");
|
|
|
25 |
|
|
|
26 |
public LoginDisplayWidget(){
|
|
|
27 |
|
|
|
28 |
//errLabel.setVisible(false);
|
|
|
29 |
|
|
|
30 |
VerticalPanel vertPanel = new VerticalPanel();
|
|
|
31 |
HorizontalPanel horizontalPanel = new HorizontalPanel();
|
|
|
32 |
vertPanel.add(headerMessage);
|
|
|
33 |
vertPanel.add(errLabel);
|
|
|
34 |
vertPanel.add(horizontalPanel);
|
|
|
35 |
horizontalPanel.add(userLabel);
|
|
|
36 |
horizontalPanel.add(userTextBox);
|
|
|
37 |
horizontalPanel = new HorizontalPanel();
|
|
|
38 |
vertPanel.add(horizontalPanel);
|
|
|
39 |
horizontalPanel.add(passwordLabel);
|
|
|
40 |
horizontalPanel.add(passwordTextBox);
|
|
|
41 |
vertPanel.add(submitButton);
|
|
|
42 |
initWidget(vertPanel);
|
|
|
43 |
}
|
|
|
44 |
@Override
|
|
|
45 |
public HasText getLoginName() {
|
|
|
46 |
// TODO Auto-generated method stub
|
|
|
47 |
return userTextBox;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
@Override
|
|
|
51 |
public HasText getMessage() {
|
|
|
52 |
// TODO Auto-generated method stub
|
|
|
53 |
return errLabel;
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
@Override
|
|
|
57 |
public HasText getPassword() {
|
|
|
58 |
// TODO Auto-generated method stub
|
|
|
59 |
return passwordTextBox;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
@Override
|
|
|
63 |
public HasClickHandlers getSubmit() {
|
|
|
64 |
// TODO Auto-generated method stub
|
|
|
65 |
return submitButton;
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
@Override
|
|
|
69 |
public Widget asWidget() {
|
|
|
70 |
// TODO Auto-generated method stub
|
|
|
71 |
return this;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
}
|