package com.raverconnection.client.view;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.raverconnection.client.event.CreateUserHandler;
import com.raverconnection.client.event.LoginHandler;
public class CreateUserPanel extends Composite {
public CreateUserPanel() {
VerticalPanel loginPanel = new VerticalPanel();
FormPanel frmCreateUser = new FormPanel();
FlexTable createUser = new FlexTable();
Label lblUsername = new Label("Username");
Label lblPassword = new Label("Password");
TextBox txtUsername = new TextBox();
PasswordTextBox txtPassword = new PasswordTextBox();
Button btnCreateUser = new Button("Create User");
HTML createUserTitle = new HTML();
txtUsername.setWidth("160px");
txtPassword.setWidth("160px");
createUserTitle.setHTML("<h3>Login</h3>");
createUserTitle.setStyleName("loginPanelTitle");
createUser.setWidget(0,0,lblUsername);
createUser.setWidget(0,1,txtUsername);
createUser.setWidget(1,0,lblPassword);
createUser.setWidget(1,1,txtPassword);
createUser.setWidget(2,0,btnCreateUser);
frmCreateUser.add(createUser);
CreateUserHandler createUserHandler = new CreateUserHandler();
btnCreateUser.addClickHandler(createUserHandler);
btnCreateUser.addKeyUpHandler(createUserHandler);
loginPanel.add(createUserTitle);
loginPanel.add(frmCreateUser);
loginPanel.setStyleName("loginPanel");
initWidget(loginPanel);
}
}