Search in sources :

Example 1 with ValidationDebouncedTextInput

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);
}
Also used : ValidationDebouncedTextInput(com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput)

Example 2 with ValidationDebouncedTextInput

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);
}
Also used : ResourceGroupComboBox(com.microsoft.azure.toolkit.intellij.common.component.resourcegroup.ResourceGroupComboBox) SubscriptionComboBox(com.microsoft.azure.toolkit.intellij.common.component.SubscriptionComboBox) Region(com.microsoft.azure.toolkit.lib.common.model.Region) List(java.util.List) RegionComboBox(com.microsoft.azure.toolkit.intellij.common.component.RegionComboBox) ValidationDebouncedTextInput(com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput)

Example 3 with ValidationDebouncedTextInput

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));
    }
}
Also used : SubscriptionComboBox(com.microsoft.azure.toolkit.intellij.common.component.SubscriptionComboBox) SpringCloudClusterComboBox(com.microsoft.azure.toolkit.intellij.springcloud.component.SpringCloudClusterComboBox) AzureValidationInfoBuilder(com.microsoft.azure.toolkit.lib.common.form.AzureValidationInfo.AzureValidationInfoBuilder) ValidationDebouncedTextInput(com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput)

Example 4 with ValidationDebouncedTextInput

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();
}
Also used : NetworkAvailabilityOptionsComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.NetworkAvailabilityOptionsComboBox) VirtualNetworkComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.VirtualNetworkComboBox) AzureStorageAccountComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.AzureStorageAccountComboBox) SubscriptionComboBox(com.microsoft.azure.toolkit.intellij.common.component.SubscriptionComboBox) VirtualMachineImageComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.VirtualMachineImageComboBox) VirtualMachineSizeComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.VirtualMachineSizeComboBox) PublicIPAddressComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.ip.PublicIPAddressComboBox) SubnetComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.SubnetComboBox) SecurityGroupComboBox(com.microsoft.azure.toolkit.intellij.vm.creation.component.SecurityGroupComboBox) ValidationDebouncedTextInput(com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput) AzurePasswordFieldInput(com.microsoft.azure.toolkit.intellij.common.component.AzurePasswordFieldInput)

Example 5 with ValidationDebouncedTextInput

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()));
        }
    });
}
Also used : DocumentAdapter(com.intellij.ui.DocumentAdapter) DocumentEvent(javax.swing.event.DocumentEvent) ValidationDebouncedTextInput(com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput)

Aggregations

ValidationDebouncedTextInput (com.microsoft.azure.toolkit.intellij.common.ValidationDebouncedTextInput)5 SubscriptionComboBox (com.microsoft.azure.toolkit.intellij.common.component.SubscriptionComboBox)3 DocumentAdapter (com.intellij.ui.DocumentAdapter)1 AzurePasswordFieldInput (com.microsoft.azure.toolkit.intellij.common.component.AzurePasswordFieldInput)1 RegionComboBox (com.microsoft.azure.toolkit.intellij.common.component.RegionComboBox)1 ResourceGroupComboBox (com.microsoft.azure.toolkit.intellij.common.component.resourcegroup.ResourceGroupComboBox)1 SpringCloudClusterComboBox (com.microsoft.azure.toolkit.intellij.springcloud.component.SpringCloudClusterComboBox)1 AzureStorageAccountComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.AzureStorageAccountComboBox)1 NetworkAvailabilityOptionsComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.NetworkAvailabilityOptionsComboBox)1 SecurityGroupComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.SecurityGroupComboBox)1 SubnetComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.SubnetComboBox)1 VirtualMachineImageComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.VirtualMachineImageComboBox)1 VirtualMachineSizeComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.VirtualMachineSizeComboBox)1 VirtualNetworkComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.VirtualNetworkComboBox)1 PublicIPAddressComboBox (com.microsoft.azure.toolkit.intellij.vm.creation.component.ip.PublicIPAddressComboBox)1 AzureValidationInfoBuilder (com.microsoft.azure.toolkit.lib.common.form.AzureValidationInfo.AzureValidationInfoBuilder)1 Region (com.microsoft.azure.toolkit.lib.common.model.Region)1 List (java.util.List)1 DocumentEvent (javax.swing.event.DocumentEvent)1