本文整理汇总了Java中org.apache.wicket.markup.html.form.PasswordTextField.setRequired方法的典型用法代码示例。如果您正苦于以下问题:Java PasswordTextField.setRequired方法的具体用法?Java PasswordTextField.setRequired怎么用?Java PasswordTextField.setRequired使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.form.PasswordTextField
的用法示例。
在下文中一共展示了PasswordTextField.setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 "";
}
}));
}
示例2: 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")));
}
示例3: 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());
}
示例4: 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 );
}
示例5: 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;
}
示例6: 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 "";
}
}));
}
示例7: AjaxPasswordFieldPanel
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
public AjaxPasswordFieldPanel(
final String id,
final String name,
final IModel<String> model,
final boolean active) {
super(id, name, model, active);
field = new PasswordTextField("passwordField", model);
field.setRequired(false);
add(field.setLabel(new Model(name)).setOutputMarkupId(true));
if (active) {
field.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID =
-1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget art) {
// nothing to do
}
});
}
}
示例8: newPwdTextField
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
/**
*
* @return
*/
private PasswordTextField newPwdTextField() {
PasswordTextField pwdField = new PasswordTextField("adapterPassword",
new PropertyModel<String>(adapterSettings, "adapterPassword"));
pwdField.add(new PopoverBehavior(Model.of(""), new StringResourceModel("step7.password.popover.text", this, null), getPopoverConfig(false)));
pwdField.setRequired(false);
return pwdField;
}
示例9: newPwdTextField
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
/**
*
* @return
*/
private PasswordTextField newPwdTextField() {
PasswordTextField pwdField = new PasswordTextField("adapterPassword",
new PropertyModel<String>(adapterSettings, "adapterPassword"));
pwdField.setRequired(false);
return pwdField;
}
示例10: PasswordInput
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
public PasswordInput(String id, IModel<String> model) {
super(id, model);
PasswordTextField text = new PasswordTextField(ID_INPUT, createCustomInputModel(model));
text.setRequired(false);
add(text);
PasswordTextField text2 = new PasswordTextField(ID_INPUT_2, new Model<String>());
text2.setRequired(false);
text2.setLabel(createStringResource("PasswordInput.confirmPassword"));
add(text2);
}
示例11: initComponents
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
protected void initComponents() {
add(new Label("host", getString("ActionContributor.Run.destination.host")));
TextField<String> hostField = new TextField<String>("hostField",
new PropertyModel<String>(destination, "host"));
hostField.setLabel(new Model<String>(getString("ActionContributor.Run.destination.host")));
hostField.setRequired(true);
hostField.add(new JcrNameValidator());
add(hostField);
add(new Label("port", getString("ActionContributor.Run.destination.port")));
TextField<Integer> portField = new TextField<Integer>("portField",
new PropertyModel<Integer>(destination, "port"));
add(portField);
add(new Label("folder", getString("Folder")));
TextField<String> folderField = new TextField<String>("folderField",
new PropertyModel<String>(destination, "folder"));
add(folderField);
add(new Label("username", getString("ActionContributor.Run.destination.username")));
TextField<String> userField = new TextField<String>("userField",
new PropertyModel<String>(destination, "username"));
add(userField);
add(new Label("password", getString("ActionContributor.Run.destination.password")));
PasswordTextField passwordField = new PasswordTextField("passwordField",
new PropertyModel<String>(destination, "password"));
passwordField.setRequired(false);
passwordField.setResetPassword(false);
add(passwordField);
add(new Label("changedFileName", getString("ActionContributor.Run.destination.changedFileName")));
TextField<String> fileNameField = new TextField<String>("changedFileNameField",
new PropertyModel<String>(destination, "changedFileName"));
fileNameField.setLabel(new Model<String>(getString("ActionContributor.Run.destination.changedFileName")));
fileNameField.setRequired(false);
fileNameField.add(new JcrNameValidator());
add(fileNameField);
}
示例12: addComponents
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
@Override
protected void addComponents(Form<Settings> form) {
final TextField<String> mailServerIpField = new TextField<String>("mailServer.ip");
form.add(mailServerIpField);
final TextField<Integer> mailServerPortField = new TextField<Integer>("mailServer.port");
form.add(mailServerPortField);
final TextField<String> mailServerSenderField = new TextField<String>("mailServer.from");
form.add(mailServerSenderField);
final TextField<String> mailServerUsernameField = new TextField<String>("mailServer.username");
form.add(mailServerUsernameField);
final PasswordTextField mailServerPasswordField = new PasswordTextField("mailServer.password");
mailServerPasswordField.setResetPassword(false);
mailServerPasswordField.setRequired(false);
form.add(mailServerPasswordField);
final CheckBox tlsCheckField = new CheckBox("mailServer.enableTls");
form.add(tlsCheckField);
form.add(new MailServerValidator(new FormComponent[] {mailServerIpField, mailServerPortField, mailServerSenderField}));
final TextField<String> distributorDatePatternField = new TextField<String>("distributor.datePattern");
distributorDatePatternField.add(new JcrNameValidator(getString("Settings.general.distributorDatePattern.error")));
form.add(distributorDatePatternField);
final TextField<String> distributorTimePatternField = new TextField<String>("distributor.timePattern");
distributorTimePatternField.add(new JcrNameValidator(getString("Settings.general.distributorTimePattern.error")));
form.add(distributorTimePatternField);
Settings settings = storageService.getSettings();
oldMailPort = settings.getMailServer().getPort();
oldMailIp = settings.getMailServer().getIp();
}
示例13: initLayout
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
private void initLayout(final boolean oldPasswordVisible) {
model = (LoadableModel<MyPasswordsDto>) getModel();
Label oldPasswordLabel = new Label(ID_OLD_PASSWORD_LABEL, createStringResource("PageSelfCredentials.oldPasswordLabel"));
add(oldPasswordLabel);
oldPasswordLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return oldPasswordVisible;
}
});
Label passwordLabel = new Label(ID_PASSWORD_LABEL, createStringResource("PageSelfCredentials.passwordLabel1"));
add(passwordLabel);
PasswordTextField oldPasswordField =
new PasswordTextField(ID_OLD_PASSWORD_FIELD, new PropertyModel<String>(model, MyPasswordsDto.F_OLD_PASSWORD));
oldPasswordField.setRequired(false);
oldPasswordField.setResetPassword(false);
add(oldPasswordField);
oldPasswordField.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
public boolean isVisible() {
return oldPasswordVisible;
};
});
PasswordPanel passwordPanel = new PasswordPanel(ID_PASSWORD_PANEL, new PropertyModel<ProtectedStringType>(model, MyPasswordsDto.F_PASSWORD));
passwordPanel.getBaseFormComponent().add(new AttributeModifier("autofocus", ""));
add(passwordPanel);
WebMarkupContainer accountContainer = new WebMarkupContainer(ID_ACCOUNTS_CONTAINER);
List<IColumn<PasswordAccountDto, String>> columns = initColumns();
ListDataProvider<PasswordAccountDto> provider = new ListDataProvider<PasswordAccountDto>(this,
new PropertyModel<List<PasswordAccountDto>>(model, MyPasswordsDto.F_ACCOUNTS));
TablePanel accounts = new TablePanel(ID_ACCOUNTS_TABLE, provider, columns);
accounts.setItemsPerPage(30);
accounts.setShowPaging(false);
if (model.getObject().getPropagation() != null && model.getObject().getPropagation()
.equals(CredentialsPropagationUserControlType.MAPPING)){
accountContainer.setVisible(false);
}
accountContainer.add(accounts);
AjaxLink help = new AjaxLink(ID_BUTTON_HELP) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
showHelpPerformed(target);
}
};
accountContainer.add(help);
add(accountContainer);
}
示例14: ResetPasswordPanel
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
protected ResetPasswordPanel(String id) {
super(id);
setVersioned(false);
final String passwordGenKey = WicketUtils.getParameter("key");
//If there is no key supplied, redirect to the login page
if (StringUtils.isEmpty(passwordGenKey)) {
setResponse();
return;
}
//If user is found
final UserInfo userInfo = findUserByKey(passwordGenKey);
if (userInfo != null) {
Form resetForm = new SecureForm("resetForm");
resetForm.add(new LabeledValue("description",
"Please choose a new password."));
final PasswordTextField passwordTextField = new PasswordTextField("password", new Model<String>());
passwordTextField.setRequired(true);
passwordTextField.add(PasswordStrengthValidator.getInstance());
resetForm.add(passwordTextField);
PasswordTextField retypedPasswordTextField = new PasswordTextField("retypedPassword", new Model<String>());
retypedPasswordTextField.setRequired(true);
resetForm.add(retypedPasswordTextField);
// validate password and retyped password
resetForm.add(new EqualPasswordInputValidator(passwordTextField, retypedPasswordTextField));
addButton(new TitledAjaxSubmitLink("reset", "Reset My Password", resetForm) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
/**
* We double check the key validity, since after the first reset, the user can back up into the page
* And won't have to pass the validity checks on init
*/
MutableUserInfo user = InfoFactoryHolder.get().copyUser(
userGroupService.findUser(userInfo.getUsername()));
String passwordKey = user.getGenPasswordKey();
if ((StringUtils.isEmpty(passwordKey)) || (!passwordKey.equals(passwordGenKey))) {
invalidKeyResponse();
return;
}
String chosenPassword = passwordTextField.getValue();
user.setPassword(securityService.generateSaltedPassword(chosenPassword));
user.setGenPasswordKey(null);
userGroupService.updateUser(user, false);
log.info("The user: '{}' has successfully reset his password.", user.getUsername());
Session.get().info("Password reset successfully.");
setResponse();
}
});
add(resetForm);
}
}
示例15: LoginPanel
import org.apache.wicket.markup.html.form.PasswordTextField; //导入方法依赖的package包/类
public LoginPanel(String string, Form form) {
super(string);
Label defaultCredentialsLabel = new Label("defaultCredentials", " (default: admin/password)");
try {
UserInfo userInfo = userGroupService.findUser("admin");
defaultCredentialsLabel.setVisible(neverLoggedIn(userInfo) && defaultAdminPassword(userInfo));
} catch (Exception ignored) {
defaultCredentialsLabel.setVisible(false);
}
add(defaultCredentialsLabel);
// add username
TextField username = new TextField("username");
username.setRequired(true);
username.setMarkupId("username");
username.setOutputMarkupId(true);
username.add(new AttributeModifier("autocomplete", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return ConstantValues.useUserNameAutoCompleteOnLogin.getString();
}
}));
add(username);
// add password
PasswordTextField password = new PasswordTextField("password");
password.setRequired(false);
password.setMarkupId("password");
password.setOutputMarkupId(true);
add(password);
// add login link
TitledPageLink ssoLoginLink = new TitledPageLink("ssoLogin", "SSO Login", null) {
@Override
protected CharSequence getURL() {
return addons.addonByType(SamlAddon.class).getSamlLoginIdentityProviderUrl();
}
@Override
public boolean isEnabled() {
return addons.addonByType(SamlAddon.class).isSamlEnabled();
}
@Override
public boolean isVisible() {
return addons.addonByType(SamlAddon.class).isSamlEnabled();
}
};
add(ssoLoginLink);
// add login link
IFormSubmittingComponent loginLink =
addons.addonByType(WebApplicationAddon.class).getLoginLink("loginLink", form);
addDefaultButton(loginLink);
// add remember me checkbox
StyledCheckbox checkbox = new StyledCheckbox("rememberMe") {
@Override
protected String getCheckboxInputName(String defaultName) {
// set the parameter name to springs' remember me filter default name
return AbstractRememberMeServices.DEFAULT_PARAMETER;
}
};
checkbox.setSubmitButton((Component) loginLink);
checkbox.setOutputMarkupPlaceholderTag(true);
checkbox.setVisible(!ConstantValues.securityDisableRememberMe.getBoolean());
add(checkbox);
// add cancel link
addButton(new TitledPageLink("cancel", "Cancel", ArtifactoryApplication.get().getHomePage()));
// add forgot password link
if (isMailServerConfigured()) {
addButton(new ForgotPasswordLink("forgotPassword"));
}
}