|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.FormSheet
org.salespointframework.desktop.formsheets.LogOnForm
public class LogOnForm
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
}
...
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.salespointframework.core.FormSheet |
---|
FormSheet.FormButton |
Field Summary | |
---|---|
private boolean |
m_fAskPassWd
True, if we asked a password. |
private java.lang.String |
m_sPassword
The current password. |
private User |
m_uCurrent
The current user |
private User |
m_uLogOnUser
Resulting user. |
Fields inherited from class org.salespointframework.core.FormSheet |
---|
BTNID_CANCEL, BTNID_OK, BUTTONBAR_BOTTOM, BUTTONBAR_LEFT, BUTTONBAR_NONE, BUTTONBAR_RIGHT, BUTTONBAR_TOP, m_fCancelled |
Constructor Summary | |
---|---|
LogOnForm(java.lang.String sCaption,
java.lang.String sUserPrompt,
java.lang.String sPassWdPrompt,
boolean fAskPassWd,
UserManager um,
java.util.Comparator<User> cmp,
UserFilter uf)
Create a new LogOnForm. |
Method Summary | |
---|---|
static char[] |
getCharFromString(java.lang.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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private User m_uCurrent
private java.lang.String m_sPassword
private boolean m_fAskPassWd
private User m_uLogOnUser
Constructor Detail |
---|
public LogOnForm(java.lang.String sCaption, java.lang.String sUserPrompt, java.lang.String sPassWdPrompt, boolean fAskPassWd, UserManager um, java.util.Comparator<User> cmp, UserFilter uf)
FormSheetContentCreator
.
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 |
---|
public static char[] getCharFromString(java.lang.String strValue)
strValue
- the String to be converted
public User getResult()
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!
public void ok()
getResult()
.
ok
in class FormSheet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |