本文整理汇总了Java中com.vaadin.ui.PasswordField类的典型用法代码示例。如果您正苦于以下问题:Java PasswordField类的具体用法?Java PasswordField怎么用?Java PasswordField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PasswordField类属于com.vaadin.ui包,在下文中一共展示了PasswordField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributesPanel
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
protected Panel getAttributesPanel() {
this.sharedKey = new PasswordField();
this.sharedKey.setRequiredError("shared secret key cannot be empty");
this.sharedKey.setRequired(true);
// best show/hide this conditionally based on Manager type.
this.sharedKey.setValue("dummy1234");
this.attributes = new Table();
this.attributes.setPageLength(0);
this.attributes.setSelectable(true);
this.attributes.setSizeFull();
this.attributes.setImmediate(true);
this.attributes.addContainerProperty("Attribute Name", String.class, null);
this.attributes.addContainerProperty("Value", PasswordField.class, null);
this.attributes.addItem(new Object[] { "Shared Secret key", this.sharedKey }, new Integer(1));
// creating panel to store attributes table
this.attributePanel = new Panel("Common Appliance Configuration Attributes:");
this.attributePanel.addStyleName("form_Panel");
this.attributePanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
this.attributePanel.setContent(this.attributes);
return this.attributePanel;
}
示例2: initAlfrescoComponent
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
protected void initAlfrescoComponent() {
alfrescoForm = new Form();
alfrescoForm.setDescription(i18nManager.getMessage(Messages.ALFRESCO_DESCRIPTION));
final TextField alfrescoServer = new TextField(i18nManager.getMessage(Messages.ALFRESCO_SERVER));
alfrescoForm.getLayout().addComponent(alfrescoServer);
final TextField alfrescoUserName = new TextField(i18nManager.getMessage(Messages.ALFRESCO_USERNAME));
alfrescoForm.getLayout().addComponent(alfrescoUserName);
final PasswordField alfrescoPassword = new PasswordField(i18nManager.getMessage(Messages.ALFRESCO_PASSWORD));
alfrescoForm.getLayout().addComponent(alfrescoPassword);
// Matching listener
alfrescoClickListener = new ClickListener() {
public void buttonClick(ClickEvent event) {
Map<String, Object> accountDetails = createAccountDetails(
"alfresco",
alfrescoUserName.getValue().toString(),
alfrescoPassword.getValue().toString(),
"server", alfrescoServer.getValue().toString()
);
fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
}
};
}
示例3: initPasswordFields
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
protected void initPasswordFields() {
inputGrid = new GridLayout(2, 2);
inputGrid.setSpacing(true);
layout.addComponent(inputGrid);
layout.setComponentAlignment(inputGrid, Alignment.MIDDLE_CENTER);
Label newPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_NEW_PASSWORD));
inputGrid.addComponent(newPasswordLabel);
passwordField1 = new PasswordField();
passwordField1.setWidth(150, UNITS_PIXELS);
inputGrid.addComponent(passwordField1);
passwordField1.focus();
Label confirmPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_CONFIRM_PASSWORD));
inputGrid.addComponent(confirmPasswordLabel);
passwordField2 = new PasswordField();
passwordField2.setWidth(150, UNITS_PIXELS);
inputGrid.addComponent(passwordField2);
}
示例4: buildDialogLayout
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
@Override
protected void buildDialogLayout() {
FormLayout mainLayout = new FormLayout();
// top-level component properties
setWidth("100%");
setHeight("100%");
final PasswordField passwordField = new PasswordField(PASSWORD_LABEL, password);
passwordField.setWidth("100%");
mainLayout.addComponent(createTextField(VIRTUOSO_URL_LABEL, virtuosoUrl));
mainLayout.addComponent(createTextField(USERNAME_LABEL, username));
mainLayout.addComponent(passwordField);
mainLayout.addComponent(new CheckBox(CLEAR_DESTINATION_GRAPH_LABEL, clearDestinationGraph));
mainLayout.addComponent(createTextField(LOAD_DIRECTORY_PATH_LABEL, loadDirectoryPath));
mainLayout.addComponent(new CheckBox(INCLUDE_SUBDIRECTORIES_LABEL, includeSubdirectories));
mainLayout.addComponent(createTextField(LOAD_FILE_PATTERN_LABEL, loadFilePattern));
mainLayout.addComponent(createTextField(TARGET_CONTEXT_LABEL, targetContext));
mainLayout.addComponent(createTextField(STATUS_UPDATE_INTERVAL_LABEL, statusUpdateInterval));
mainLayout.addComponent(createTextField(THREAD_COUNT_LABEL, threadCount));
mainLayout.addComponent(new CheckBox(SKIP_ON_ERROR_LABEL, skipOnError));
setCompositionRoot(mainLayout);
}
示例5: enter
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
@Override
public void enter(ViewChangeEvent event) {
usernameField = new TextField("Username");
passwordField = new PasswordField("Password");
loginButton = new Button("Login");
loginButton.addClickListener(this);
loginButton.setClickShortcut(KeyCode.ENTER);
VerticalLayout layout = new VerticalLayout();
setCompositionRoot(layout);
layout.setSizeFull();
layout.addComponent(usernameField);
layout.addComponent(passwordField);
layout.addComponent(loginButton);
}
示例6: buildFields
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
private Component buildFields() {
HorizontalLayout fields = new HorizontalLayout();
fields.setSpacing(true);
fields.addStyleName("fields");
username = new TextField("Username");
username.setIcon(FontAwesome.USER);
username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
username.setTabIndex(1);
username.focus();
password = new PasswordField("Password");
password.setIcon(FontAwesome.LOCK);
password.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
password.setTabIndex(2);
final Button signin = new Button("Sign In", this);
signin.addStyleName(ValoTheme.BUTTON_PRIMARY);
signin.setClickShortcut(KeyCode.ENTER);
signin.setTabIndex(4);
fields.addComponents(username, password, signin);
fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);
return fields;
}
示例7: initComponents
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
/**
* Setup UI.
*/
private void initComponents() {
userNameInput = new TextField(Messages.getString("LoginPanel.userName"), ""); //$NON-NLS-1$ //$NON-NLS-2$
userNameInput.focus();
passwordInput = new PasswordField(Messages.getString("LoginPanel.password"), ""); //$NON-NLS-1$ //$NON-NLS-2$
btLogin = new Button(Messages.getString("LoginPanel.login")); //$NON-NLS-1$
btLogin.setClickShortcut(KeyCode.ENTER);
Label caption = new Label(Messages.getString("LoginPanel.title"), ContentMode.HTML); //$NON-NLS-1$
caption.addStyleName("login-caption"); //$NON-NLS-1$
addCenteredComponent(caption);
addCenteredComponent(userNameInput);
addCenteredComponent(passwordInput);
addCenteredComponent(btLogin);
}
示例8: bindPasswordField
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
public PasswordField bindPasswordField(String fieldLabel, String fieldName)
{
PasswordField field = formHelper.bindPasswordField(this, fieldGroup, fieldLabel, fieldName);
this.fieldList.add(field);
return field;
}
示例9: populateForm
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
@Override
public void populateForm() throws Exception {
this.providerHttps = new CheckBox("Https");
this.providerHttps.setValue(false);
this.rabbitMQIp = new TextField("RabbitMQ IP");
this.rabbitMQUserName = new TextField("RabbitMQ User Name");
this.rabbitMQUserName.setRequired(true);
this.rabbitMQUserPassword = new PasswordField("RabbitMQ Password");
this.rabbitMQUserPassword.setRequired(true);
this.rabbitMQPort = new TextField("RabbitMQ Port");
this.rabbitMQPort.setRequired(true);
this.rabbitMQUserName.setRequiredError(this.rabbitMQUserName.getCaption() + " cannot be empty");
this.rabbitMQUserPassword.setRequiredError(this.rabbitMQUserPassword.getCaption() + " cannot be empty");
this.rabbitMQPort.setRequiredError(this.rabbitMQPort.getCaption() + " cannot be empty");
//fill this form with default/previous values
this.providerHttps.setValue(new Boolean(this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_HTTPS)));
if (this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_IP) != null) {
this.rabbitMQIp.setValue(this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_IP));
}
if (this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_USER) != null) {
this.rabbitMQUserName.setValue(this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_USER));
}
if (this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_USER_PASSWORD) != null) {
this.rabbitMQUserPassword
.setValue(this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_USER_PASSWORD));
}
if (this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_PORT) != null) {
this.rabbitMQPort.setValue(this.baseVCWindow.providerAttributes.get(ATTRIBUTE_KEY_RABBITMQ_PORT));
}
this.form.addComponent(this.providerHttps);
this.form.addComponent(this.rabbitMQIp);
this.form.addComponent(this.rabbitMQUserName);
this.form.addComponent(this.rabbitMQUserPassword);
this.form.addComponent(this.rabbitMQPort);
}
示例10: providerPanel
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
protected Panel providerPanel() {
this.providerPanel = new Panel();
this.providerPanel.setImmediate(true);
this.providerPanel.setCaption(OPENSTACK_CAPTION);
this.providerIP = new TextField("IP");
this.providerIP.setImmediate(true);
this.adminDomainId = new TextField("Admin Domain Id");
this.adminDomainId.setImmediate(true);
this.adminProjectName = new TextField("Admin Project Name");
this.adminProjectName.setImmediate(true);
this.providerUser = new TextField("User Name");
this.providerUser.setImmediate(true);
this.providerPW = new PasswordField("Password");
this.providerPW.setImmediate(true);
// adding not null constraint
this.adminDomainId.setRequired(true);
this.adminDomainId.setRequiredError(this.providerPanel.getCaption() + " Admin Domain Id cannot be empty");
this.adminProjectName.setRequired(true);
this.adminProjectName.setRequiredError(this.providerPanel.getCaption() + " Admin Project Name cannot be empty");
this.providerIP.setRequired(true);
this.providerIP.setRequiredError(this.providerPanel.getCaption() + " IP cannot be empty");
this.providerUser.setRequired(true);
this.providerUser.setRequiredError(this.providerPanel.getCaption() + " User Name cannot be empty");
this.providerPW.setRequired(true);
this.providerPW.setRequiredError(this.providerPanel.getCaption() + " Password cannot be empty");
FormLayout providerFormPanel = new FormLayout();
providerFormPanel.addComponent(this.providerIP);
providerFormPanel.addComponent(this.adminDomainId);
providerFormPanel.addComponent(this.adminProjectName);
providerFormPanel.addComponent(this.providerUser);
providerFormPanel.addComponent(this.providerPW);
this.providerPanel.setContent(providerFormPanel);
return this.providerPanel;
}
示例11: populateForm
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
@Override
public void populateForm() {
this.loginName = new TextField("User Name");
this.loginName.setImmediate(true);
this.firstName = new TextField("First Name");
this.lastName = new TextField("Last Name");
this.password = new PasswordField("Password");
this.password.setImmediate(true);
this.email = new TextField("Email");
this.email.addValidator(new EmailValidator("Please enter a valid email address"));
this.role = new ComboBox("Role");
this.role.setTextInputAllowed(false);
this.role.setNullSelectionAllowed(false);
this.role.addItem(UpdateUserWindow.ROLE_ADMIN);
this.role.select(UpdateUserWindow.ROLE_ADMIN);
// adding not null constraint
this.loginName.setRequired(true);
this.loginName.setRequiredError("User Name cannot be empty");
this.password.setRequired(true);
this.password.setRequiredError("Password cannot be empty");
this.role.setRequired(true);
this.form.setMargin(true);
this.form.setSizeUndefined();
this.form.addComponent(this.loginName);
this.form.addComponent(this.firstName);
this.form.addComponent(this.lastName);
this.form.addComponent(this.password);
this.form.addComponent(this.email);
this.form.addComponent(this.role);
this.loginName.focus();
}
示例12: populateForm
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
@Override
public void populateForm() throws Exception {
this.form.setMargin(true);
this.form.setSizeUndefined();
HorizontalLayout layout = new HorizontalLayout();
this.passwordField = new PasswordField();
this.passwordField.setRequired(true);
layout.addComponent(this.passwordField);
layout.setCaption(VmidcMessages.getString(VmidcMessages_.PASSWORD_CAPTION));
this.form.addComponent(layout);
}
示例13: init
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
setSizeFull();
user = new TextField("User:");
user.setWidth("300px");
user.setRequiredIndicatorVisible(true);
password = new PasswordField("Password:");
password.setWidth("300px");
user.setRequiredIndicatorVisible(true);
password.setValue("");
VerticalLayout fields = new VerticalLayout(user, password, loginButton);
fields.setCaption("Please login to access the application");
fields.setSpacing(true);
fields.setMargin(new MarginInfo(true, true, true, false));
fields.setSizeUndefined();
VerticalLayout uiLayout = new VerticalLayout(fields);
uiLayout.setSizeFull();
uiLayout.setComponentAlignment(fields, Alignment.MIDDLE_CENTER);
setFocusedComponent(user);
setContent(uiLayout);
}
示例14: addForm
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
private void addForm() {
FormLayout loginForm = new FormLayout();
MessageProvider mp = ServiceContextManager.getServiceContext().getService(MessageProvider.class);
username = new TextField(mp.getMessage("default.label.username"));
password = new PasswordField(mp.getMessage("default.label.password"));
loginForm.addComponents(username, password);
addComponent(loginForm);
loginForm.setSpacing(true);
for(Component component:loginForm){
component.setWidth("100%");
}
username.focus();
}
示例15: buildFields
import com.vaadin.ui.PasswordField; //导入依赖的package包/类
private Component buildFields() {
HorizontalLayout fields = new HorizontalLayout();
fields.setSpacing(true);
fields.addStyleName("fields");
final TextField username = new TextField("Username");
username.setIcon(FontAwesome.USER);
username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
final PasswordField password = new PasswordField("Password");
password.setIcon(FontAwesome.LOCK);
password.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
final Button signin = new Button("Sign In");
signin.addStyleName(ValoTheme.BUTTON_PRIMARY);
signin.setClickShortcut(KeyCode.ENTER);
signin.focus();
fields.addComponents(username, password, signin);
fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT);
signin.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
DashboardEventBus.post(new UserLoginRequestedEvent(username
.getValue(), password.getValue()));
}
});
return fields;
}