SalesPoint Framework v3.1

users.stdforms
Class LogOnForm

java.lang.Object
  extended bysale.FormSheet
      extended byusers.stdforms.LogOnForm
All Implemented Interfaces:
Serializable

public class LogOnForm
extends FormSheet

FormSheet that can be used for log on procedures. The FormSheet will contain a JComboBox allowing to select from a range of user names and optionally a password input line. When the user clicks the "OK" button, the FormSheet checks if the password entered equals the password of the user selected. Prior to this, the password will be garbled using the current global password garbler. If the checking was successful, getResult() will return the selected user, otherwise it will return null.

A typical use sequence would look something like that:


 ...
 LogOnForm lof = new LogOnForm ("Please log on",
                                "Select your user name:",
                                "Enter your password:",
                                true,
                                UserManager.getGlobalUM(),
                                null,
                                null);

 ...setFormSheet (lof);

 if (lof.getResult() != null) {
   // do log on of user lof.getResult
 }
 ...

 

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class sale.FormSheet
FormSheet.FormButton
 
Field Summary
 
Fields inherited from class sale.FormSheet
BTNID_CANCEL, BTNID_OK, m_fCancelled
 
Constructor Summary
LogOnForm(String sCaption, String sUserPrompt, String sPassWdPrompt, boolean fAskPassWd, UserManager um, Comparator cmp, UserFilter uf)
          Create a new LogOnForm.
 
Method Summary
static char[] getCharFromString(String strValue)
          Converst a String to char[]-Array
 User getResult()
          Return the user that was selected if any.
 void ok()
          Overridden to check the password input and make sure the selected user can be returned by getResult().
 
Methods inherited from class sale.FormSheet
addButton, addButton, addContentCreator, attach, attach, attach, buttonIterator, buttonIterator, cancel, close, detachDisplay, detachProcess, detachSalesPoint, fillBtnPanel, getButton, getButtonsLock, getCaption, getComponent, getComponentLock, getDisplay, getDisplayLock, getProcess, getSalesPoint, isCancelled, removeAllButtons, removeButton, setCaption, setComponent, setWaitResponse, toString, waitResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogOnForm

public LogOnForm(String sCaption,
                 String sUserPrompt,
                 String sPassWdPrompt,
                 boolean fAskPassWd,
                 UserManager um,
                 Comparator cmp,
                 UserFilter uf)
Create a new LogOnForm. Uses a FormSheetContentCreator.

Parameters:
sCaption - the caption of the FormSheet.
sUserPrompt - a string prompting the user to select his/her user name.
sPassWdPrompt - a string prompting the user to enter his/her password. May be null only if fAskPassWd is false.
fAskPassWd - if false no password is needed and selection of the user name is sufficient.
um - the UserManager that manages the users to select from. Normally the global UserManager.
cmp - a comparator that defines the order in which the user names appear. If null, users will be ordered by their names.
uf - a filter that allows only a subset of the users to be selected from. If null, no filtering will occur.
Method Detail

getCharFromString

public static char[] getCharFromString(String strValue)
Converst a String to char[]-Array

Parameters:
strValue - the String to be converted
Returns:
the converted value as char[]-Array

getResult

public User getResult()
Return the user that was selected if any. Return null if no user was selected, the password was wrong or the FormSheet was cancelled. The value is only valid after the FormSheet was closed!

Override:
Never

ok

public void ok()
Overridden to check the password input and make sure the selected user can be returned by getResult().

Overrides:
ok in class FormSheet
Override:
Never

SalesPoint Framework v3.1