|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractSingleComponentContainer
com.vaadin.ui.LoginForm
public class LoginForm
Login form with auto-completion and auto-fill for all major browsers. You can
derive from this class and implement the
createContent(com.vaadin.ui.TextField, com.vaadin.ui.PasswordField, com.vaadin.ui.Button)
method to build the layout using the text fields and login button that are
passed to that method. The supplied components are specially treated so that
they work with password managers.
If you need to change the URL as part of the login procedure, call
setLoginMode(LoginMode) with the argument LoginForm.LoginMode.DEFERRED
in your implementation of
createContent.
To customize the fields or to replace them with your own implementations, you
can override createUserNameField(), createPasswordField()
and createLoginButton(). These methods are called automatically and
cannot be called by your code. Captions can be reset by overriding
#getUserNameFieldCaption(), #getPasswordFieldCaption() and
getLoginButtonCaption().
| Nested Class Summary | |
|---|---|
static class |
LoginForm.LoginEvent
This event is sent when login form is submitted. |
static interface |
LoginForm.LoginListener
Login listener is a class capable to listen LoginEvents sent from LoginBox |
static class |
LoginForm.LoginMode
Determines the way in which the login form reacts to a login on the server side. |
| Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents |
|---|
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener |
| Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
|---|
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener |
| Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
|---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
| Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
|---|
Sizeable.Unit |
| Field Summary |
|---|
| Fields inherited from class com.vaadin.ui.AbstractComponent |
|---|
DESIGN_ATTR_PLAIN_TEXT |
| Fields inherited from interface com.vaadin.server.Sizeable |
|---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
| Constructor Summary | |
|---|---|
LoginForm()
|
|
| Method Summary | |
|---|---|
void |
addListener(LoginForm.LoginListener listener)
Deprecated. As of 7.0, replaced by addLoginListener(LoginListener) |
void |
addLoginListener(LoginForm.LoginListener listener)
Adds LoginListener to handle login logic |
void |
attach()
Notifies the connector that it is connected to a VaadinSession (and therefore also to a UI). |
protected Component |
createContent(TextField userNameField,
PasswordField passwordField,
Button loginButton)
Create the content for the login form with the supplied user name field, password field and the login button. |
protected Button |
createLoginButton()
Customize the login button. |
protected PasswordField |
createPasswordField()
Customize the password field. |
protected TextField |
createUserNameField()
Customize the user name field. |
java.lang.String |
getLoginButtonCaption()
|
LoginForm.LoginMode |
getLoginMode()
Returns the LoginForm.LoginMode for this login form. |
java.lang.String |
getPasswordCaption()
|
protected com.vaadin.shared.ui.loginform.LoginFormState |
getState()
Returns the shared state bean with information to be sent from the server to the client. |
java.lang.String |
getUsernameCaption()
|
void |
removeListener(LoginForm.LoginListener listener)
Deprecated. As of 7.0, replaced by removeLoginListener(LoginListener) |
void |
removeLoginListener(LoginForm.LoginListener listener)
Removes LoginListener |
void |
setLoginButtonCaption(java.lang.String cap)
|
void |
setLoginMode(LoginForm.LoginMode loginMode)
Set the LoginForm.LoginMode for this login form. |
void |
setPasswordCaption(java.lang.String cap)
|
void |
setUsernameCaption(java.lang.String cap)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.vaadin.ui.Component |
|---|
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
| Methods inherited from interface com.vaadin.server.ClientConnector |
|---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
| Methods inherited from interface com.vaadin.shared.Connector |
|---|
getConnectorId |
| Methods inherited from interface com.vaadin.server.Sizeable |
|---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthUndefined |
| Constructor Detail |
|---|
public LoginForm()
| Method Detail |
|---|
public LoginForm.LoginMode getLoginMode()
LoginForm.LoginMode for this login form. The default is
LoginForm.LoginMode.DIRECT.
public void setLoginMode(LoginForm.LoginMode loginMode)
LoginForm.LoginMode for this login form. The default is
LoginForm.LoginMode.DIRECT
loginMode - the login modeprotected TextField createUserNameField()
public java.lang.String getUsernameCaption()
public void setUsernameCaption(java.lang.String cap)
protected PasswordField createPasswordField()
public java.lang.String getPasswordCaption()
public void setPasswordCaption(java.lang.String cap)
protected Button createLoginButton()
public java.lang.String getLoginButtonCaption()
public void setLoginButtonCaption(java.lang.String cap)
protected com.vaadin.shared.ui.loginform.LoginFormState getState()
AbstractComponent
getState in class AbstractComponentpublic void attach()
ClientConnector
The caller of this method is #setParent(ClientConnector) if the
parent is itself already attached to the session. If not, the parent will
call the ClientConnector.attach() for all its children when it is attached to
the session. This method is always called before the connector's data is
sent to the client-side for the first time.
The attachment logic is implemented in AbstractClientConnector.
attach in interface ClientConnectorattach in interface Componentattach in class AbstractComponent
protected Component createContent(TextField userNameField,
PasswordField passwordField,
Button loginButton)
createUserNameField(),
createPasswordField() and createLoginButton(). If you
only want to change the default captions, override
#getUserNameFieldCaption(), #getPasswordFieldCaption()
and getLoginButtonCaption(). You do not have to use the login
button in your layout.
userNameField - the user name text fieldpasswordField - the password fieldloginButton - the login button
public void addLoginListener(LoginForm.LoginListener listener)
listener - @Deprecated public void addListener(LoginForm.LoginListener listener)
addLoginListener(LoginListener)
public void removeLoginListener(LoginForm.LoginListener listener)
listener - @Deprecated public void removeListener(LoginForm.LoginListener listener)
removeLoginListener(LoginListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||