Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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