use of com.microsoft.azure.toolkit.intellij.common.component.AzurePasswordFieldInput in project azure-tools-for-java by Microsoft.
the class PasswordUtils method generatePasswordFieldInput.
public static AzurePasswordFieldInput generatePasswordFieldInput(JPasswordField passwordField, JTextField adminUsernameTextField) {
return new AzurePasswordFieldInput(passwordField) {
@Override
public AzureValidationInfo doValidate() {
final AzureValidationInfo info = super.doValidate();
if (!AzureValidationInfo.OK.equals(info)) {
return info;
}
final String adminUsername = adminUsernameTextField.getText();
final String value = this.getValue();
return PasswordUtils.validatePassword(value, adminUsername, this);
}
};
}
use of com.microsoft.azure.toolkit.intellij.common.component.AzurePasswordFieldInput in project azure-tools-for-java by Microsoft.
the class PasswordUtils method generateConfirmPasswordFieldInput.
public static AzurePasswordFieldInput generateConfirmPasswordFieldInput(JPasswordField confirmPasswordField, JPasswordField passwordField) {
return new AzurePasswordFieldInput(confirmPasswordField) {
@Override
public AzureValidationInfo doValidate() {
final AzureValidationInfo info = super.doValidate();
if (!AzureValidationInfo.OK.equals(info)) {
return info;
}
final String value = this.getValue();
final char[] password = passwordField.getPassword();
final String passwordAsString = password != null ? String.valueOf(password) : StringUtils.EMPTY;
return PasswordUtils.validateConfirmPassword(value, passwordAsString, this);
}
};
}
use of com.microsoft.azure.toolkit.intellij.common.component.AzurePasswordFieldInput in project azure-tools-for-java by Microsoft.
the class VMCreationDialog method createUIComponents.
private void createUIComponents() {
// TODO: place custom component creation code here
this.cbSubscription = new SubscriptionComboBox();
this.cbSubscription.setRequired(true);
this.cbImage = new VirtualMachineImageComboBox();
this.cbImage.setRequired(true);
this.cbSize = new VirtualMachineSizeComboBox();
this.cbSize.setRequired(true);
this.cbAvailabilityOptions = new NetworkAvailabilityOptionsComboBox();
this.cbVirtualNetwork = new VirtualNetworkComboBox();
this.cbVirtualNetwork.setRequired(true);
this.cbSubnet = new SubnetComboBox();
this.cbSubnet.setRequired(true);
this.cbSecurityGroup = new SecurityGroupComboBox();
this.cbPublicIp = new PublicIPAddressComboBox();
this.cbPublicIp.setRequired(true);
this.cbStorageAccount = new AzureStorageAccountComboBox();
this.txtUserName = new ValidationDebouncedTextInput();
this.txtUserName.setRequired(true);
this.txtVisualMachineName = new ValidationDebouncedTextInput();
this.txtVisualMachineName.setRequired(true);
this.txtVisualMachineName.setValidator(this::validateVirtualMachineName);
this.txtMaximumPrice = new ValidationDebouncedTextInput();
this.txtPassword = new JPasswordField();
this.passwordFieldInput = new AzurePasswordFieldInput(txtPassword, true);
this.txtConfirmPassword = new JPasswordField();
this.confirmPasswordFieldInput = new AzurePasswordFieldInput(txtConfirmPassword, true);
this.cbSubscription.refreshItems();
}
Aggregations