当前位置: 首页>>代码示例>>Java>>正文


Java PasswordField.setIcon方法代码示例

本文整理汇总了Java中com.vaadin.ui.PasswordField.setIcon方法的典型用法代码示例。如果您正苦于以下问题:Java PasswordField.setIcon方法的具体用法?Java PasswordField.setIcon怎么用?Java PasswordField.setIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.PasswordField的用法示例。


在下文中一共展示了PasswordField.setIcon方法的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;
}
 
开发者ID:GJRTimmer,项目名称:vaadin-security-template,代码行数:27,代码来源:LoginUI.java

示例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;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:31,代码来源:LoginView.java

示例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");
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:8,代码来源:AbstractHawkbitLoginUI.java

示例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;
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:45,代码来源:LoginUI.java


注:本文中的com.vaadin.ui.PasswordField.setIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。