本文整理汇总了Java中com.vaadin.ui.PasswordField.setImmediate方法的典型用法代码示例。如果您正苦于以下问题:Java PasswordField.setImmediate方法的具体用法?Java PasswordField.setImmediate怎么用?Java PasswordField.setImmediate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.PasswordField
的用法示例。
在下文中一共展示了PasswordField.setImmediate方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildForm
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
private void buildForm() {
username = new TextField("Username");
username.setWidth("100%");
username.setImmediate(true);
username.setValidationVisible(false);
username.setNullRepresentation("");
username.setRequired(true);
form.addComponent(username);
password = new PasswordField("Password");
password.setWidth("100%");
password.setImmediate(true);
password.setValidationVisible(false);
password.setNullRepresentation("");
password.setRequired(true);
form.addComponent(password);
firstName = new TextField("First name");
firstName.setWidth("100%");
firstName.setValidationVisible(false);
firstName.setNullRepresentation("");
firstName.setImmediate(true);
firstName.setRequired(true);
form.addComponent(firstName);
lastName = new TextField("Last name");
lastName.setWidth("100%");
lastName.setImmediate(true);
lastName.setNullRepresentation("");
lastName.setValidationVisible(false);
lastName.setRequired(true);
form.addComponent(lastName);
binder.bind(username, "username");
binder.bind(password, "password");
binder.bind(firstName, "firstName");
binder.bind(lastName, "lastName");
}
示例2: buildForm
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
private void buildForm() {
username = new TextField("Username");
username.setWidth("100%");
username.setImmediate(true);
username.setValidationVisible(false);
username.setNullRepresentation("");
form.addComponent(username);
password = new PasswordField("Password");
password.setWidth("100%");
password.setImmediate(true);
password.setValidationVisible(false);
password.setNullRepresentation("");
form.addComponent(password);
firstName = new TextField("First name");
firstName.setWidth("100%");
firstName.setValidationVisible(false);
firstName.setNullRepresentation("");
firstName.setImmediate(true);
form.addComponent(firstName);
lastName = new TextField("Last name");
lastName.setWidth("100%");
lastName.setImmediate(true);
lastName.setNullRepresentation("");
lastName.setValidationVisible(false);
form.addComponent(lastName);
binder.bind(username, "username");
binder.bind(password, "password");
binder.bind(firstName, "firstName");
binder.bind(lastName, "lastName");
}
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecuritySocial,代码行数:36,代码来源:SignupContent.java
示例3: createEditFields
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ComponentContainer createEditFields() {
final FormLayout form = new ExtaFormLayout();
passField = new PasswordField("Пароль");
// passField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
// passField.setIcon(Fontello.LOCK);
passField.setImmediate(true);
passField.setDescription("Введите пароль для входа в систему");
passField.setInputPrompt("Пароль");
passField.setRequired(true);
passField.setRequiredError("Пароль пользователя не может быть пустым.");
passField.setNullRepresentation("");
form.addComponent(passField);
passConfField = new PasswordField("Подтверждение пароля");
// passConfField.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
// passConfField.setIcon(Fontello.LOCK);
passConfField.setImmediate(true);
passConfField.setDescription("Введите повторно пароль для для его подтвержедения");
passConfField.setInputPrompt("Подтверждение пароля");
passConfField.setRequired(true);
passConfField.setNullRepresentation("");
// TODO: Сделать симметричную проверку пароля
passConfField.addValidator(new Validator() {
private static final long serialVersionUID = 1L;
@Override
public void validate(final Object value) throws InvalidValueException {
if (!value.equals(passField.getValue()))
throw new InvalidValueException("Пароли не совпадают!");
}
});
passConfField.setValue(getEntity().getPassword());
form.addComponent(passConfField);
return form;
}
示例4: bindPasswordField
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
public PasswordField bindPasswordField(AbstractLayout form, FieldGroup group, String fieldLabel, String fieldName)
{
PasswordField field = new SplitPasswordField(fieldLabel);
field.setWidth("100%");
field.setImmediate(true);
field.setNullRepresentation("");
field.setNullSettingAllowed(false);
field.setId(fieldLabel.replace(" ", ""));
addValueChangeListeners(field);
doBinding(group, fieldName, field);
form.addComponent(field);
return field;
}
示例5: init
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@SuppressWarnings("serial")
@Override
protected void init(VaadinRequest request) {
getUI().setLocale(BBPlay.getLanguage(request.getLocale().getLanguage()));
I18n.init(i18n);
getPage().setTitle("BBPlay");
String token = request.getParameter("token");
if (token == null || token.isEmpty()) {
BBPlay.error(I18n.t("noToken"));
return;
}
User user = userService.checkToken(token);
if (user == null) {
BBPlay.error(I18n.t("wrongPasswordToken"));
return;
}
FormLayout loginForm = new FormLayout();
loginForm.setSizeUndefined();
passwordField = new PasswordField(I18n.t("changePassword.new"));
passwordFieldRepeat = new PasswordField(I18n.t("changePassword.confirm"));
passwordFieldRepeat.setImmediate(false);
passwordFieldRepeat.addValidator(new AbstractStringValidator(I18n
.t("changePassword.errorMatch")) {
@Override
protected boolean isValidValue(String value) {
return value.equals(passwordField.getValue());
}
});
reset = new Button(I18n.t("reset"));
loginForm.addComponent(passwordField);
loginForm.addComponent(passwordFieldRepeat);
loginForm.addComponent(reset);
reset.addStyleName(ValoTheme.BUTTON_PRIMARY);
reset.setClickShortcut(ShortcutAction.KeyCode.ENTER);
reset.addClickListener(event -> reset(user));
VerticalLayout loginLayout = new VerticalLayout();
loginLayout.setSpacing(true);
loginLayout.setSizeUndefined();
loginLayout.addComponent(loginForm);
loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);
VerticalLayout rootLayout = new VerticalLayout(loginLayout);
rootLayout.setSizeFull();
rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
setContent(rootLayout);
setSizeFull();
}
示例6: windowContent
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@SuppressWarnings("serial")
private VerticalLayout windowContent() {
VerticalLayout root = new VerticalLayout();
root.setMargin(true);
final FormLayout content = new FormLayout();
confirmPassword = new PasswordField(I18n.t("changePassword.confirm"));
confirmPassword.setImmediate(false);
confirmPassword.addValidator(new AbstractStringValidator(I18n
.t("changePassword.errorMatch")) {
@Override
protected boolean isValidValue(String value) {
return value.equals(newPassword.getValue());
}
});
content.addComponent(oldPassword = new PasswordField(I18n.t("changePassword.current")));
content.addComponent(newPassword = new PasswordField(I18n.t("changePassword.new")));
content.addComponent(confirmPassword);
root.addComponent(content);
HorizontalLayout footer = new HorizontalLayout();
footer.setWidth("100%");
footer.setSpacing(true);
footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
Label footerText = new Label();
Button ok = new Button(I18n.t("ok"));
ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
ok.addClickListener(event -> {
if (confirmPassword.isValid()) {
String changePasswordResult = userService.changePassword(oldPassword.getValue(),
newPassword.getValue());
if (changePasswordResult == null) {
ChangePasswordWindow.this.close();
BBPlay.info(I18n.t("changePassword.success"));
} else {
BBPlay.error(changePasswordResult);
}
}
});
Button cancel = new Button(I18n.t("cancel"));
cancel.addClickListener(event -> ChangePasswordWindow.this.close());
footer.addComponents(footerText, ok, cancel);
footer.setExpandRatio(footerText, 1);
root.addComponent(footer);
return root;
}
示例7: buildMainLayout
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(false);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// comboBoxConnectionType
comboBoxConnectionType = new ComboBox();
comboBoxConnectionType.setCaption("Type of SQL Connection");
comboBoxConnectionType.setImmediate(false);
comboBoxConnectionType.setWidth("-1px");
comboBoxConnectionType.setHeight("-1px");
mainLayout.addComponent(comboBoxConnectionType);
// textFieldDataSource
textFieldDataSource = new TextField();
textFieldDataSource.setCaption("Data Source");
textFieldDataSource.setImmediate(false);
textFieldDataSource.setWidth("-1px");
textFieldDataSource.setHeight("-1px");
mainLayout.addComponent(textFieldDataSource);
mainLayout.setExpandRatio(textFieldDataSource, 1.0f);
// comboBoxSQLDriver
comboBoxSQLDriver = new ComboBox();
comboBoxSQLDriver.setCaption("JDBC Driver");
comboBoxSQLDriver.setImmediate(false);
comboBoxSQLDriver.setWidth("-1px");
comboBoxSQLDriver.setHeight("-1px");
mainLayout.addComponent(comboBoxSQLDriver);
mainLayout.setExpandRatio(comboBoxSQLDriver, 1.0f);
// textFieldConnectionURL
textFieldConnectionURL = new TextField();
textFieldConnectionURL.setCaption("Connection URL");
textFieldConnectionURL.setImmediate(false);
textFieldConnectionURL.setWidth("-1px");
textFieldConnectionURL.setHeight("-1px");
mainLayout.addComponent(textFieldConnectionURL);
mainLayout.setExpandRatio(textFieldConnectionURL, 1.0f);
// textFieldUser
textFieldUser = new TextField();
textFieldUser.setCaption("User");
textFieldUser.setImmediate(false);
textFieldUser.setWidth("-1px");
textFieldUser.setHeight("-1px");
mainLayout.addComponent(textFieldUser);
mainLayout.setExpandRatio(textFieldUser, 1.0f);
// textFieldPassword
textFieldPassword = new PasswordField();
textFieldPassword.setCaption("Password");
textFieldPassword.setImmediate(false);
textFieldPassword.setWidth("-1px");
textFieldPassword.setHeight("-1px");
mainLayout.addComponent(textFieldPassword);
mainLayout.setExpandRatio(textFieldPassword, 1.0f);
// buttonTest
buttonTest = new Button();
buttonTest.setCaption("Test Connection");
buttonTest.setImmediate(true);
buttonTest.setWidth("-1px");
buttonTest.setHeight("-1px");
mainLayout.addComponent(buttonTest);
mainLayout.setComponentAlignment(buttonTest, new Alignment(48));
return mainLayout;
}
示例8: postConstruct
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@Override
public void postConstruct() {
super.postConstruct();
setSizeFull();
layout = new VerticalLayout();
layout.setSizeFull();
layout.setSpacing(true);
setCompositionRoot(layout);
caption = new Label("Sign in to Vaadin4Spring Security Demo");
caption.addStyleName(ValoTheme.LABEL_H2);
caption.setSizeUndefined();
layout.addComponent(caption);
layout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);
loginPanel = new VerticalLayout();
loginPanel.setSizeUndefined();
loginPanel.setSpacing(true);
loginPanel.setMargin(true);
layout.addComponent(loginPanel);
layout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
layout.setExpandRatio(loginPanel, 1);
errorMessage = new Label();
errorMessage.setWidth("300px");
errorMessage.addStyleName(ValoTheme.LABEL_FAILURE);
errorMessage.setVisible(false);
loginPanel.addComponent(errorMessage);
username = new TextField("Username");
username.setImmediate(true);
username.setWidth("300px");
username.setNullRepresentation("");
username.setInputPrompt("Enter your username");
loginPanel.addComponent(username);
password = new PasswordField("Password");
password.setImmediate(true);
password.setWidth("300px");
password.setNullRepresentation("");
loginPanel.addComponent(password);
rememberMe = new CheckBox("Remember me");
rememberMe.setValue(false);
rememberMe.addStyleName(ValoTheme.CHECKBOX_LARGE);
loginPanel.addComponent(rememberMe);
btnLogin = new Button("Signin", FontAwesome.UNLOCK);
btnLogin.addStyleName(ValoTheme.BUTTON_PRIMARY);
btnLogin.addClickListener(this);
btnLogin.setWidth("100%");
loginPanel.addComponent(btnLogin);
final Label infoLabel = new Label(FontAwesome.INFO_CIRCLE.getHtml() + " You can sign in as: <br/>\"user\" with password \"user\" <br/>\"admin\" with password \"admin\".", ContentMode.HTML);
infoLabel.setWidth("300px");
loginPanel.addComponent(infoLabel);
}
示例9: SignInContent
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
public SignInContent(Security security) {
super();
setSizeFull();
setSpacing(true);
this.security = security;
caption = new Label("Sign in to Vaadin4Spring Security Social Demo");
caption.addStyleName(ValoTheme.LABEL_H2);
caption.setSizeUndefined();
addComponent(caption);
setComponentAlignment(caption, Alignment.MIDDLE_CENTER);
loginPanel = new VerticalLayout();
loginPanel.setSizeUndefined();
loginPanel.setSpacing(true);
loginPanel.setMargin(true);
addComponent(loginPanel);
setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
setExpandRatio(loginPanel, 1);
errorMessage = new Label();
errorMessage.setWidth("300px");
errorMessage.addStyleName(ValoTheme.LABEL_FAILURE);
errorMessage.setVisible(false);
loginPanel.addComponent(errorMessage);
username = new TextField("Username");
username.setImmediate(true);
username.setWidth("300px");
loginPanel.addComponent(username);
password = new PasswordField("Password");
password.setImmediate(true);
password.setWidth("300px");
loginPanel.addComponent(password);
btnLogin = new Button("Signin", FontAwesome.UNLOCK);
btnLogin.addStyleName(ValoTheme.BUTTON_PRIMARY);
btnLogin.addClickListener(this);
btnLogin.setWidth("100%");
loginPanel.addComponent(btnLogin);
btnFacebookLogin = new Button("Signin with Facebook", FontAwesome.FACEBOOK);
btnFacebookLogin.addStyleName(ValoTheme.BUTTON_PRIMARY);
btnFacebookLogin.setWidth("100%");
btnFacebookLogin.addClickListener(this);
loginPanel.addComponent(btnFacebookLogin);
btnGoogleLogin = new Button("Signin with Google", FontAwesome.GOOGLE_PLUS);
btnGoogleLogin.addStyleName(ValoTheme.BUTTON_PRIMARY);
btnGoogleLogin.setWidth("100%");
btnGoogleLogin.addClickListener(this);
loginPanel.addComponent(btnGoogleLogin);
final Label infoLabel = new Label(FontAwesome.INFO_CIRCLE.getHtml() + " You can sign in with username \"user\" and password \"user\".", ContentMode.HTML);
infoLabel.setWidth("300px");
loginPanel.addComponent(infoLabel);
}
开发者ID:markoradinovic,项目名称:Vaadin4Spring-MVP-Sample-SpringSecuritySocial,代码行数:60,代码来源:SignInContent.java
示例10: buildMainLayout
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("700px");
mainLayout.setHeight("440px");
mainLayout.setMargin(true);
// top-level component properties
setWidth("700px");
setHeight("440px");
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("-1px");
activeField.setHeight("-1px");
activeField.setTabIndex(1);
activeField.setRequired(true);
mainLayout.addComponent(activeField, "top:14.0px;left:507.0px;");
// commentField
commentField = new TextField();
commentField.setCaption("Comentario");
commentField.setImmediate(false);
commentField.setWidth("540px");
commentField.setHeight("160px");
commentField.setTabIndex(3);
mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
// passwordField
passwordField = new PasswordField();
passwordField.setCaption("Clave");
passwordField.setImmediate(false);
passwordField.setWidth("160px");
passwordField.setHeight("-1px");
passwordField.setTabIndex(2);
passwordField.setRequired(true);
mainLayout.addComponent(passwordField, "top:56.0px;left:20.0px;");
// usernameField
usernameField = new TextField();
usernameField.setCaption("Nombre usuario");
usernameField.setImmediate(false);
usernameField.setWidth("160px");
usernameField.setHeight("-1px");
usernameField.setRequired(true);
mainLayout.addComponent(usernameField, "top:17.0px;left:20.0px;");
// rolesField
rolesField = new Table();
rolesField.setCaption("Roles");
rolesField.setImmediate(false);
rolesField.setWidth("501px");
rolesField.setHeight("140px");
mainLayout.addComponent(rolesField, "top:281.0px;left:19.0px;");
// brnAdd
brnAdd = new Button();
brnAdd.setCaption("+");
brnAdd.setImmediate(true);
brnAdd.setWidth("-1px");
brnAdd.setHeight("-1px");
mainLayout.addComponent(brnAdd, "top:283.0px;left:525.0px;");
// btnRemove
btnRemove = new Button();
btnRemove.setCaption("-");
btnRemove.setImmediate(true);
btnRemove.setWidth("-1px");
btnRemove.setHeight("-1px");
mainLayout.addComponent(btnRemove, "top:320.0px;left:525.0px;");
return mainLayout;
}
示例11: buildVerticalLayoutSecurity
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@AutoGenerated
private VerticalLayout buildVerticalLayoutSecurity() {
// common part: create layout
verticalLayoutSecurity = new VerticalLayout();
verticalLayoutSecurity.setImmediate(false);
verticalLayoutSecurity.setWidth("100.0%");
verticalLayoutSecurity.setHeight("100.0%");
verticalLayoutSecurity.setMargin(true);
verticalLayoutSecurity.setSpacing(true);
// embedded_1
applicationLogoEmbedded = new Embedded();
applicationLogoEmbedded.setImmediate(false);
applicationLogoEmbedded.setWidth("342px");
applicationLogoEmbedded.setHeight("102px");
applicationLogoEmbedded.setType(1);
applicationLogoEmbedded.setMimeType("image/png");
verticalLayoutSecurity.addComponent(applicationLogoEmbedded);
// usernameField
usernameField = new TextField();
usernameField.setCaption("Nombre de usuario");
usernameField.setImmediate(false);
usernameField.setWidth("100.0%");
usernameField.setHeight("-1px");
usernameField.setNullRepresentation(" ");
verticalLayoutSecurity.addComponent(usernameField);
// passwordField
passwordField = new PasswordField();
passwordField.setCaption("Clave de acceso");
passwordField.setImmediate(false);
passwordField.setWidth("100.0%");
passwordField.setHeight("-1px");
verticalLayoutSecurity.addComponent(passwordField);
// demoField
demoField = new Label();
demoField.setWidth("-1px");
demoField.setHeight("-1px");
demoField.setVisible(false);
demoField.setContentMode(Label.CONTENT_XHTML);
verticalLayoutSecurity.addComponent(demoField);
verticalLayoutSecurity.setComponentAlignment(demoField, Alignment.TOP_CENTER);
// versionField
versionField = new Label();
versionField.setWidth("-1px");
versionField.setHeight("-1px");
versionField.setContentMode(Label.CONTENT_XHTML);
verticalLayoutSecurity.addComponent(versionField);
verticalLayoutSecurity.setComponentAlignment(versionField, Alignment.TOP_CENTER);
return verticalLayoutSecurity;
}
示例12: buildVerticalLayout_1
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@AutoGenerated
private VerticalLayout buildVerticalLayout_1() {
// common part: create layout
verticalPasswordLayout = new VerticalLayout();
verticalPasswordLayout.setImmediate(false);
verticalPasswordLayout.setWidth("100.0%");
verticalPasswordLayout.setHeight("100.0%");
verticalPasswordLayout.setMargin(true);
verticalPasswordLayout.setSpacing(true);
// currentPasswordField
currentPasswordField = new PasswordField();
currentPasswordField.setCaption("Contraseña actual");
currentPasswordField.setImmediate(true);
currentPasswordField.setWidth("100.0%");
currentPasswordField.setHeight("-1px");
verticalPasswordLayout.addComponent(currentPasswordField);
// newPasswordField
newPasswordField = new PasswordField();
newPasswordField.setCaption("Nueva Contraseña");
newPasswordField.setImmediate(true);
newPasswordField.setWidth("100.0%");
newPasswordField.setHeight("-1px");
verticalPasswordLayout.addComponent(newPasswordField);
// confirmPasswordField
confirmPasswordField = new PasswordField();
confirmPasswordField.setCaption("Confirmar contraseña");
confirmPasswordField.setImmediate(true);
confirmPasswordField.setWidth("100.0%");
confirmPasswordField.setHeight("-1px");
confirmPasswordField.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (confirmPasswordField.getValue() != null)
applyPasswordChangebutton.setEnabled(true);
else
applyPasswordChangebutton.setEnabled(false);
}
});
verticalPasswordLayout.addComponent(confirmPasswordField);
// horizontalLayout_1
horizontalPasswordLayout = buildHorizontalLayout_1();
verticalPasswordLayout.addComponent(horizontalPasswordLayout);
verticalPasswordLayout.setExpandRatio(horizontalPasswordLayout, 1.0f);
verticalPasswordLayout.setComponentAlignment(horizontalPasswordLayout,
new Alignment(6));
return verticalPasswordLayout;
}
示例13: buildMainLayout
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("340px");
mainLayout.setHeight("180px");
// top-level component properties
setWidth("340px");
setHeight("180px");
// usernameField
fieldUsuario = new TextField();
fieldUsuario.setImmediate(false);
fieldUsuario.setWidth("210px");
fieldUsuario.setHeight("-1px");
mainLayout.addComponent(fieldUsuario, "top:20.0px;left:100.0px;");
// usernameLabel
labelUsuario = new Label();
labelUsuario.setImmediate(false);
labelUsuario.setWidth("-1px");
labelUsuario.setHeight("-1px");
labelUsuario.setValue("Username:");
mainLayout.addComponent(labelUsuario, "top:22.0px;left:20.0px;");
// passwordField
fieldContraseña = new PasswordField();
fieldContraseña.setImmediate(false);
fieldContraseña.setWidth("210px");
fieldContraseña.setHeight("-1px");
mainLayout.addComponent(fieldContraseña, "top:56.0px;left:100.0px;");
// passwordLabel
labelContraseña = new Label();
labelContraseña.setImmediate(false);
labelContraseña.setWidth("-1px");
labelContraseña.setHeight("-1px");
labelContraseña.setValue("Password:");
mainLayout.addComponent(labelContraseña, "top:60.0px;left:20.0px;");
// loginButton
botonIniciarSesion = new Button();
botonIniciarSesion.setCaption("Sign in");
botonIniciarSesion.setImmediate(true);
botonIniciarSesion.setWidth("-1px");
botonIniciarSesion.setHeight("-1px");
mainLayout.addComponent(botonIniciarSesion, "top:94.0px;left:209.0px;");
// errorLabel
labelError = new Label();
labelError.setImmediate(false);
labelError.setWidth("-1px");
labelError.setHeight("-1px");
mainLayout.addComponent(labelError, "top:142.0px;left:20.0px;");
return mainLayout;
}
示例14: buildMainLayout
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("340px");
mainLayout.setHeight("180px");
// top-level component properties
setWidth("340px");
setHeight("180px");
// fieldUsuario
fieldUsuario = new TextField();
fieldUsuario.setImmediate(false);
fieldUsuario.setWidth("210px");
fieldUsuario.setHeight("-1px");
mainLayout.addComponent(fieldUsuario, "top:20.0px;left:100.0px;");
// labelUsuario
labelUsuario = new Label();
labelUsuario.setImmediate(false);
labelUsuario.setWidth("-1px");
labelUsuario.setHeight("-1px");
labelUsuario.setValue("Usuario:");
mainLayout.addComponent(labelUsuario, "top:22.0px;left:20.0px;");
// fieldPassword
fieldContraseña = new PasswordField();
fieldContraseña.setImmediate(false);
fieldContraseña.setWidth("210px");
fieldContraseña.setHeight("-1px");
mainLayout.addComponent(fieldContraseña, "top:56.0px;left:100.0px;");
// labelContrasea
labelPassword = new Label();
labelPassword.setImmediate(false);
labelPassword.setWidth("-1px");
labelPassword.setHeight("-1px");
labelPassword.setValue("Contraseña:");
mainLayout.addComponent(labelPassword, "top:60.0px;left:20.0px;");
// botonIniciarSesion
buttonIniciarSesion = new Button();
buttonIniciarSesion.setCaption("Iniciar Sesión");
buttonIniciarSesion.setImmediate(true);
buttonIniciarSesion.setWidth("101px");
buttonIniciarSesion.setHeight("-1px");
mainLayout.addComponent(buttonIniciarSesion, "top:94.0px;right:30.0px;");
// labelError
labelError = new Label();
labelError.setImmediate(false);
labelError.setWidth("-1px");
labelError.setHeight("-1px");
labelError.setValue("Label");
mainLayout.addComponent(labelError, "top:142.0px;left:20.0px;");
return mainLayout;
}