i3mclient.i3m
Class LoginGUI

java.lang.Object
  |
  +--i3mclient.i3m.LoginGUI
All Implemented Interfaces:
DisposeListener, EventListener, SelectionListener, ServerMethodListener, SMCreateAccountListener, SMLoginAccountListener, org.eclipse.swt.internal.SWTEventListener

public class LoginGUI
extends Object
implements SelectionListener, SMCreateAccountListener, SMLoginAccountListener, DisposeListener

Creates the login window.

Author:
Dirk Plate

Constructor Summary
LoginGUI(Shell parentWindow)
          Constructor.
 
Method Summary
 void addLoginGUIListener(LoginGUIListener listener)
          Adds a loginGUI listener.
 void errorMessage(String message)
          Shows a message box with an error message.
 Shell getWindow()
           
 void i3mServerException(I3MServerException exception)
          Called if a server exception is thrown.
 void loginAccountDone(long userID)
          Called if loginAccount was successfull.
 void removeLoginGUIListener(LoginGUIListener listener)
          Remove a loginGUI listener.
 void setGUIEnabled(boolean enabled)
          En- or disable all gui elements.
 void setUserIDText(String text)
          Set a userID in the userID input widget.
 void userIDReceived(long newUserID)
          Called if createAccount was successfull.
 void widgetDefaultSelected(SelectionEvent arg0)
           
 void widgetDisposed(DisposeEvent arg0)
           
 void widgetSelected(SelectionEvent event)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginGUI

public LoginGUI(Shell parentWindow)
Constructor.

Parameters:
parentWindow - The parent window of the new created login shell.
Method Detail

setUserIDText

public void setUserIDText(String text)
Set a userID in the userID input widget.

Parameters:
text - The text which should be inserted in the userID input widget

getWindow

public Shell getWindow()
Returns:
A reference to the window

widgetSelected

public void widgetSelected(SelectionEvent event)
Specified by:
widgetSelected in interface SelectionListener

errorMessage

public void errorMessage(String message)
Shows a message box with an error message.

Parameters:
message - The error message which should appear in the message box

widgetDefaultSelected

public void widgetDefaultSelected(SelectionEvent arg0)
Specified by:
widgetDefaultSelected in interface SelectionListener

userIDReceived

public void userIDReceived(long newUserID)
Description copied from interface: SMCreateAccountListener
Called if createAccount was successfull.

Specified by:
userIDReceived in interface SMCreateAccountListener
Parameters:
newUserID - The new userID of the user

i3mServerException

public void i3mServerException(I3MServerException exception)
Description copied from interface: ServerMethodListener
Called if a server exception is thrown.

Specified by:
i3mServerException in interface ServerMethodListener
Parameters:
exception - The converted I3M-server exception

loginAccountDone

public void loginAccountDone(long userID)
Description copied from interface: SMLoginAccountListener
Called if loginAccount was successfull.

Specified by:
loginAccountDone in interface SMLoginAccountListener
Parameters:
userID - The userID of the user who logged in

addLoginGUIListener

public void addLoginGUIListener(LoginGUIListener listener)
Adds a loginGUI listener. The listener will be informed about a successfull login.

Parameters:
listener - The listener whoch will be added.

removeLoginGUIListener

public void removeLoginGUIListener(LoginGUIListener listener)
Remove a loginGUI listener. The listener will be no longer informed about a sccessfull login.

Parameters:
listener - The listener which will be removed.

setGUIEnabled

public void setGUIEnabled(boolean enabled)
En- or disable all gui elements.

Parameters:
enabled - Enable or disable.

widgetDisposed

public void widgetDisposed(DisposeEvent arg0)
Specified by:
widgetDisposed in interface DisposeListener