org.spiffyui.client.login
Class LoginPanel

java.lang.Object
  extended by Composite
      extended by org.spiffyui.client.login.LoginPanel

public class LoginPanel
extends Composite

A reusable login dialog.

The styles (css classes) that the panel uses are as follows:


Constructor Summary
protected LoginPanel(java.lang.String title, LoginStringHelper helper)
          Create a new LoginPanel.
 
Method Summary
 void doRequest()
          perform login request
 LoginStringHelper getHelper()
           
static LoginPanel getLoginPanel()
           
 TextBox getPwd()
           
 TextBox getUsername()
           
 boolean isInRequest()
           
 boolean isRepeat()
           
 void onKeyUp(KeyUpEvent event)
           
 void setCallbackKey(java.lang.Object key)
           
 void setInRequest(boolean inRequest)
           
 void setIsRepeat(boolean isRepeat)
          Check if this is login case or renew token case (after token has timed out) and show the login dialog differently
static void setLoginPanel(LoginPanel loginPanel)
           
 void setTokenServerUrl(java.lang.String url)
           
 void setVisible(boolean visible)
           
 void show()
          show the login panel
static void showLoginPanel(LoginStringHelper helper, java.lang.String title, java.lang.Object callbackKey, java.lang.String tokenServerUrl, java.lang.String code, boolean isRepeat, java.lang.String username)
          Show the login panel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginPanel

protected LoginPanel(java.lang.String title,
                     LoginStringHelper helper)
Create a new LoginPanel.

Parameters:
title - title of the login panel
helper - string helper for getting strings used in login panel
Method Detail

showLoginPanel

public static void showLoginPanel(LoginStringHelper helper,
                                  java.lang.String title,
                                  java.lang.Object callbackKey,
                                  java.lang.String tokenServerUrl,
                                  java.lang.String code,
                                  boolean isRepeat,
                                  java.lang.String username)
Show the login panel. This should only be called from AuthUtil

Parameters:
helper - the string helper for this login panel
title - the title of this login dialog
callbackKey - the callback key used to replay the REST call that caused the need for login
tokenServerUrl - the url for the token server the user is logging in to
code - the error code
isRepeat - true if this login request is a repeat because of token time out, false otherwise
username - the username of the currently logged in user. This parameter is optional.

setIsRepeat

public void setIsRepeat(boolean isRepeat)
Check if this is login case or renew token case (after token has timed out) and show the login dialog differently

Parameters:
isRepeat - boolean indicating whether this is login or renew token case

setCallbackKey

public void setCallbackKey(java.lang.Object key)

setTokenServerUrl

public void setTokenServerUrl(java.lang.String url)

doRequest

public void doRequest()
perform login request


setVisible

public void setVisible(boolean visible)

show

public void show()
show the login panel


onKeyUp

public void onKeyUp(KeyUpEvent event)

getUsername

public TextBox getUsername()

getPwd

public TextBox getPwd()

isInRequest

public boolean isInRequest()

setInRequest

public void setInRequest(boolean inRequest)

isRepeat

public boolean isRepeat()

getHelper

public LoginStringHelper getHelper()

getLoginPanel

public static LoginPanel getLoginPanel()

setLoginPanel

public static void setLoginPanel(LoginPanel loginPanel)