use of com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput in project azure-tools-for-java by Microsoft.
the class PublicIpAddressCreationDialog method createUIComponents.
private void createUIComponents() {
// TODO: place custom component creation code here
txtName = new ValidationDebouncedTextInput();
txtName.setRequired(true);
}
use of com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput in project azure-tools-for-java by Microsoft.
the class RedisCreationDialog method createUIComponents.
private void createUIComponents() {
this.subscriptionComboBox = new SubscriptionComboBox();
this.resourceGroupComboBox = new ResourceGroupComboBox();
this.regionComboBox = new RegionComboBox() {
protected List<? extends Region> loadItems() {
if (Objects.nonNull(this.subscription)) {
return Azure.az(AzureRedis.class).listSupportedRegions(subscription.getId());
}
return Collections.emptyList();
}
};
this.redisNameTextField = new ValidationDebouncedTextInput();
this.pricingComboBox = new AzureComboBoxSimple<>(PricingTier::values);
}
use of com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput in project azure-tools-for-java by Microsoft.
the class AbstractSpringCloudAppInfoPanel method init.
protected void init() {
final SubscriptionComboBox selectorSubscription = this.getSelectorSubscription();
final SpringCloudClusterComboBox selectorCluster = this.getSelectorCluster();
final ValidationDebouncedTextInput textName = this.getTextName();
selectorSubscription.setRequired(true);
selectorSubscription.addItemListener(this::onSubscriptionChanged);
selectorCluster.setRequired(true);
selectorCluster.addItemListener(this::onClusterChanged);
textName.setRequired(true);
textName.setValue(this.defaultAppName);
textName.setValidator(() -> {
try {
validateSpringCloudAppName(textName.getValue(), this.cluster);
} catch (final IllegalArgumentException e) {
final AzureValidationInfoBuilder builder = AzureValidationInfo.builder();
return builder.input(textName).type(AzureValidationInfo.Type.ERROR).message(e.getMessage()).build();
}
return AzureValidationInfo.OK;
});
if (Objects.nonNull(this.cluster)) {
selectorSubscription.setValue(new ItemReference<>(this.cluster.subscriptionId(), Subscription::getId));
selectorCluster.setValue(new ItemReference<>(this.cluster.name(), IAzureResource::name));
}
}
use of com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput 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();
}
use of com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput in project azure-tools-for-java by Microsoft.
the class VirtualNetworkDialog method createUIComponents.
private void createUIComponents() {
// todo: add name validator
txtName = new ValidationDebouncedTextInput();
txtName.setRequired(true);
txtSubnetName = new ValidationDebouncedTextInput();
txtSubnetName.setRequired(true);
txtAddressSpace = new ValidationDebouncedTextInput();
txtAddressSpace.setRequired(true);
txtAddressSpace.setValidator(() -> validateSubnet(txtAddressSpace.getValue()));
txtAddressSpace.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(@NotNull DocumentEvent e) {
lblAddressSpaceDetails.setText(getSubnetInfo(txtAddressSpace.getValue()));
}
});
txtSubnetAddressRange = new ValidationDebouncedTextInput();
txtSubnetAddressRange.setRequired(true);
txtSubnetAddressRange.setValidator(() -> validateSubnet(txtSubnetAddressRange.getValue()));
txtSubnetAddressRange.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(@NotNull DocumentEvent e) {
lblSubnetAddressDetails.setText(getSubnetInfo(txtSubnetAddressRange.getValue()));
}
});
}
Aggregations