本文整理汇总了Java中org.apache.wicket.markup.html.form.PasswordTextField类的典型用法代码示例。如果您正苦于以下问题:Java PasswordTextField类的具体用法?Java PasswordTextField怎么用?Java PasswordTextField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PasswordTextField类属于org.apache.wicket.markup.html.form包,在下文中一共展示了PasswordTextField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildMainLayout
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
private void buildMainLayout() {
this.loginForm = new WarnOnExitForm("loginForm");
this.emailInput = new TextField<String>("emailInput", Model.of(""));
this.loginForm.add(this.emailInput);
this.passwordInput = new PasswordTextField("passwordInput", Model.of(""));
this.loginForm.add(this.passwordInput);
this.addLoginButton();
this.addRegisterLink();
this.add(this.loginForm);
this.logoutForm = new Form<Object>("logoutForm");
this.addLogoutButton();
this.add(this.logoutForm);
if (((AuthenticatedSession) Session.get()).getUser() != null) {
this.loginForm.setVisible(false);
} else {
this.logoutForm.setVisible(false);
}
}
示例2: onInitialize
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
input = new PasswordTextField("input", Model.of(getModelObject()));
input.setRequired(false);
input.setResetPassword(false);
add(input);
String autocomplete = EditableUtils.getAutocomplete(getPropertyDescriptor().getPropertyGetter());
if (autocomplete != null)
input.add(AttributeAppender.append("autocomplete", autocomplete));
add(new AttributeAppender("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (hasErrors(true))
return " has-error";
else
return "";
}
}));
}
示例3: LoginForm
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public LoginForm(String markupId) {
super(markupId);
this.setDefaultModel(new CompoundPropertyModel<Object>(this));
this.add(new TextField("username").setRequired(true));
this.add(new PasswordTextField("password").setRequired(true));
Button submitBtn = new AjaxButton("loginBtn", Model.of("Sign In")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
if (AuthenticatedWebSession.get().signIn(username, password))
setResponsePage(DiscoverItemsPage.class);
else {
target.add(ComponentUtils.displayBlock(alert));
}
}
};
this.add(submitBtn);
this.setDefaultButton(submitBtn);
}
示例4: addSearchFields
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
private void addSearchFields(TitledBorder borderDn) {
searchPattern = entity.getSearch();
if (searchPattern == null) {
searchPattern = new SearchPattern();
}
borderDn.add(new TextField<>("searchFilter", new PropertyModel<String>(searchPattern, "searchFilter")));
borderDn.add(new SchemaHelpBubble("searchFilter.help", new SchemaHelpModel(searchPattern, "searchFilter")));
borderDn.add(new TextField<>("searchBase", new PropertyModel<String>(searchPattern, "searchBase")));
borderDn.add(new SchemaHelpBubble("searchBase.help", new SchemaHelpModel(searchPattern, "searchBase")));
borderDn.add(new StyledCheckbox("searchSubTree", new PropertyModel<Boolean>(searchPattern, "searchSubTree")));
borderDn.add(new SchemaHelpBubble("searchSubTree.help", new SchemaHelpModel(searchPattern, "searchSubTree")));
borderDn.add(new TextField<>("managerDn", new PropertyModel<String>(searchPattern, "managerDn")));
borderDn.add(new SchemaHelpBubble("managerDn.help", new SchemaHelpModel(searchPattern, "managerDn")));
PasswordTextField managerPasswordField = new PasswordTextField(
"managerPassword", new PropertyModel<String>(searchPattern, "managerPassword"));
managerPasswordField.setRequired(false);
managerPasswordField.setResetPassword(false);
borderDn.add(managerPasswordField);
borderDn.add(new SchemaHelpBubble("managerPassword.help",
new SchemaHelpModel(searchPattern, "managerPassword")));
}
示例5: addTestConnectionFields
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
private void addTestConnectionFields() {
TitledBorder borderTest = new TitledBorder("borderTest");
form.add(borderTest);
borderTest.add(new TextField<>("testUsername", new PropertyModel<String>(this, "testUsername")));
borderTest.add(new HelpBubble("testUsername.help", "Username to test the LDAP connection"));
PasswordTextField testPasswordField = new PasswordTextField(
"testPassword", new PropertyModel<String>(this, "testPassword"));
testPasswordField.setRequired(false);
testPasswordField.setResetPassword(false);
borderTest.add(testPasswordField);
borderTest.add(new HelpBubble("testPassword.help", "Password to test the LDAP connection"));
// Test connection button
borderTest.add(createTestConnectionButton());
}
示例6: SSOLoginPasswordPage
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public SSOLoginPasswordPage() {
final SSOLoginData loginData = SSOUtils.getSsoLoginData(this);
if (loginData == null) {
RequestCycle.get().setResponsePage(new SSOLoginErrorPage(new Model<String>("No login data found")));
}
final LoginBean loginBean = new LoginBean();
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
doOnSubmit(loginBean, loginData);
}
};
add(form);
form.add(new TextField<String>("username", new PropertyModel<String>(loginBean, "username")));
form.add(new PasswordTextField("password", new PropertyModel<String>(loginBean, "password")));
errorMessageLabel = new Label("message", errorMessageModel);
errorMessageLabel.setVisible(StringUtils.hasLength(errorMessageModel.getObject()));
form.add(errorMessageLabel);
}
示例7: SSOLoginHOTPPage
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public SSOLoginHOTPPage() {
final SSOLoginData loginData = SSOUtils.getSsoLoginData(this);
if (loginData == null) {
RequestCycle.get().setResponsePage(new SSOLoginErrorPage(new Model<String>("No login data found")));
}
final LoginBean loginBean = new LoginBean();
Form<Void> form = new Form<Void>("form") {
@Override
protected void onSubmit() {
doOnSubmit(loginBean, loginData);
}
};
add(form);
form.add(new PasswordTextField("hotp", new PropertyModel<String>(loginBean, "hotp")));
errorMessageLabel = new Label("message", errorMessageModel);
errorMessageLabel.setVisible(StringUtils.hasLength(errorMessageModel.getObject()));
form.add(errorMessageLabel);
}
示例8: LoginPageForm
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public LoginPageForm( String id )
{
super( id );
HttpServletRequest servletReq = ( HttpServletRequest ) getRequest().getContainerRequest();
Principal principal = servletReq.getUserPrincipal();
if ( principal != null )
{
LOG.info( "user already logged in, route to launch page instead" );
setResponsePage( LaunchPage.class );
}
add( new Button( "login" ) );
TextField userId = new TextField( "userId", new PropertyModel<String>( this, "userId" ) );
add( userId );
PasswordTextField pw = new PasswordTextField( "pswdField", new PropertyModel<String>( this, "pswdField" ) );
pw.setRequired( false );
add( pw );
}
示例9: AjaxPasswordFieldPanel
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public AjaxPasswordFieldPanel(
final String id, final String name, final IModel<String> model, final boolean enableOnChange) {
super(id, name, model);
field = new PasswordTextField("passwordField", model);
add(field.setLabel(new ResourceModel(name, name)).setRequired(false).setOutputMarkupId(true));
if (enableOnChange && !isReadOnly()) {
field.add(new IndicatorAjaxFormComponentUpdatingBehavior(Constants.ON_CHANGE) {
private static final long serialVersionUID = -1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget art) {
// nothing to do
}
});
}
}
示例10: LoginPage
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public LoginPage() {
final Form<User> form = new Form<User>("loginForm",
new CompoundPropertyModel<User>(user));
TextField<String> nameField = new TextField<String>(User.NAME);
form.add(nameField);
PasswordTextField passwordField = new PasswordTextField(User.PASSWORD);
form.add(passwordField);
Button submit = new Button("loginButton") {
@Override
public void onSubmit() {
User dbUser = userDAO.findByUsername(user.getName());
if (dbUser != null
&& dbUser.getPassword().equals(user.getPassword())) {
LoginPage.this.getSession().setUser(dbUser);
setResponsePage(NotesPage.class);
} else {
form.error("Invalid login");
}
};
};
submit.add(new ButtonBehavior());
form.add(submit);
add(form);
}
示例11: LoginForm
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
public LoginForm(String id) {
super(id, new CompoundPropertyModel<LoginFormModel>(new LoginFormModel()));
add(new LocalFeedbackPanel("feedback", this));
add(new PasswordTextField("password"));
add(new Button("submit") {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
if (BlogServiceHolder.get().isOwnerPasswordMatch(LoginForm.this.getModelObject().getPassword())) {
((BlogSession) getSession()).setAuthenticated(true);
setResponsePage(IndexPage.class);
} else {
error("Wrong password");
}
}
});
}
示例12: addChangePassword
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
private Form<Void> addChangePassword() {
final PasswordTextField password = new PasswordTextField("password");
final PasswordTextField confirmPassword = new PasswordTextField("confirmPassword");
form = new BootstrapForm<Void>("form");
form.add(new FormBehavior().type(FormType.Horizontal));
form.setOutputMarkupId(true);
form.setOutputMarkupPlaceholderTag(true);
FormGroup formGroupPassword = new FormGroup("formGroupPassword", Model.of("Password"));
formGroupPassword.add(password);
form.add(formGroupPassword);
FormGroup formGroupConfirmPassword = new FormGroup("formGroupConfirmPassword", Model.of("Confirm Password"));
formGroupConfirmPassword.add(confirmPassword);
form.add(formGroupConfirmPassword);
FormGroup formGrouButton = new FormGroup("formGroupButton");
BootstrapButton submitButton = new BootstrapButton("submit-button", Buttons.Type.Default);
submitButton.setLabel(Model.of("Submit"));
formGrouButton.add(submitButton);
form.add(formGrouButton);
return form;
}
示例13: createBody
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, ChangePasswordPopupPanel.class);
passwordForm = new Form<Void>("form");
body.add(passwordForm);
newPasswordField = new PasswordTextField("newPassword", Model.of(""));
newPasswordField.setLabel(new ResourceModel("administration.user.field.newPassword"));
newPasswordField.setRequired(true);
passwordForm.add(newPasswordField);
confirmPasswordField = new PasswordTextField("confirmPassword", Model.of(""));
confirmPasswordField.setLabel(new ResourceModel("administration.user.field.confirmPassword"));
confirmPasswordField.setRequired(true);
passwordForm.add(confirmPasswordField);
return body;
}
示例14: setupInputs
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
private void setupInputs() {
usernameWrapper = new WebMarkupContainer("user.detail.username.wrapper");
passwordWrapper = new WebMarkupContainer("user.detail.password.wrapper");
usernameWrapper.setOutputMarkupId(true);
passwordWrapper.setOutputMarkupId(true);
add(passwordWrapper);
add(usernameWrapper);
username = new RequiredTextField<>("user.username",
new PropertyModel<String>(this, "_username"));
password = new PasswordTextField("user.password",
new PropertyModel<String>(this, "_password"));
passwordWrapper.add(password);
usernameWrapper.add(username);
firstname = new TextField<>("user.firstname",
new PropertyModel<String>(this, "_firstname"));
lastname = new TextField<>("user.lastname", new PropertyModel<String>(
this, "_lastname"));
add(firstname);
add(lastname);
}
示例15: onInitialize
import org.apache.wicket.markup.html.form.PasswordTextField; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
input = new PasswordTextField("input", Model.of(getModelObject()));
input.setResetPassword(true);
input.setRequired(false);
add(input);
inputAgain = new PasswordTextField("inputAgain", Model.of(getModelObject()));
inputAgain.setResetPassword(true);
inputAgain.setRequired(false);
add(inputAgain);
String autocomplete = EditableUtils.getAutocomplete(getPropertyDescriptor().getPropertyGetter());
if (autocomplete != null) {
input.add(AttributeAppender.append("autocomplete", autocomplete));
inputAgain.add(AttributeAppender.append("autocomplete", autocomplete));
}
add(new AttributeAppender("class", new LoadableDetachableModel<String>() {
@Override
protected String load() {
if (hasErrors(true))
return " has-error";
else
return "";
}
}));
}