Package com.raverconnection.client.view

Source Code of com.raverconnection.client.view.LoginPanel

package com.raverconnection.client.view;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
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.LoginHandler;
import com.raverconnection.client.event.SetUserHandler;*/
import com.raverconnection.client.event.LoginHandler;

public class LoginPanel extends Composite {
  String username;
  String password;
 
  public LoginPanel() {
    VerticalPanel loginPanel = new VerticalPanel();
    FormPanel frmLogin = new FormPanel();
    FlexTable login = new FlexTable();
    Label lblUsername = new Label("Username");
    Label lblPassword = new Label("Password");
    TextBox txtUsername = new TextBox();
    PasswordTextBox txtPassword = new PasswordTextBox();
    Button btnLogin = new Button("Login");
    HTML loginTitle = new HTML();
   
    txtUsername.setWidth("160px");
    txtPassword.setWidth("160px");
   
    loginTitle.setHTML("<h3>Login</h3>");
    loginTitle.setStyleName("loginPanelTitle");
   
    login.setWidget(0,0,lblUsername);
    login.setWidget(0,1,txtUsername);
    login.setWidget(1,0,lblPassword);
    login.setWidget(1,1,txtPassword);
    login.setWidget(2,0,btnLogin);
   
    frmLogin.add(login);
    LoginHandler loginHandler = new LoginHandler();
    btnLogin.addClickHandler(loginHandler);
    btnLogin.addKeyUpHandler(loginHandler);
   
    loginPanel.add(loginTitle);
    loginPanel.add(frmLogin);
    loginPanel.setStyleName("loginPanel");
   
    initWidget(loginPanel);
  }
 
  public void onClick(ClickEvent event) {
   
  }
   
  public void onKeyUp(KeyUpEvent event) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
     
    }
  }
 
 
}
TOP

Related Classes of com.raverconnection.client.view.LoginPanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.