本文整理汇总了Java中com.vaadin.ui.PasswordField.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java PasswordField.addStyleName方法的具体用法?Java PasswordField.addStyleName怎么用?Java PasswordField.addStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.PasswordField
的用法示例。
在下文中一共展示了PasswordField.addStyleName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: buildPasswordField
import com.vaadin.ui.PasswordField; //导入方法依赖的package包/类
private void buildPasswordField() {
password = new PasswordField(i18n.getMessage("label.login.password"));
password.setIcon(FontAwesome.LOCK);
password.addStyleName(
ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
password.setId("login-password");
}
示例4: 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");
// Pre-populate for convenience
username.setValue("admin");
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);
password.setValue("[email protected]");
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() {
/**
*
*/
private static final long serialVersionUID = -8816421044737741430L;
@Override
public void buttonClick(final ClickEvent event) {
try {
VaadinServletService.getCurrentServletRequest().login(
username.getValue(), password.getValue());
} catch (ServletException e) {
Notification.show("Authentication Failed");
return;
}
Page.getCurrent().setLocation("secured");
}
});
return fields;
}