Search in sources :

Example 1 with CreateVirtualNetworkForm

use of com.microsoft.intellij.forms.CreateVirtualNetworkForm in project azure-tools-for-java by Microsoft.

the class SettingsStep method showNewVirtualNetworkForm.

private void showNewVirtualNetworkForm() {
    final String resourceGroupName = createNewRadioButton.isSelected() ? resourceGrpField.getText() : resourceGrpCombo.getSelectedItem().toString();
    final CreateVirtualNetworkForm form = new CreateVirtualNetworkForm(project, model.getSubscription().getSubscriptionId(), model.getRegion(), model.getName());
    form.setOnCreate(new Runnable() {

        @Override
        public void run() {
            VirtualNetwork newVirtualNetwork = form.getNetwork();
            if (newVirtualNetwork != null) {
                model.setNewNetwork(newVirtualNetwork);
                model.setWithNewNetwork(true);
                ((DefaultComboBoxModel) networkComboBox.getModel()).insertElementAt(newVirtualNetwork.name + " (New)", 0);
                networkComboBox.setSelectedIndex(0);
            } else {
                networkComboBox.setSelectedItem(null);
            }
        }
    });
    form.show();
}
Also used : VirtualNetwork(com.microsoft.tooling.msservices.model.vm.VirtualNetwork) CreateVirtualNetworkForm(com.microsoft.intellij.forms.CreateVirtualNetworkForm)

Aggregations

CreateVirtualNetworkForm (com.microsoft.intellij.forms.CreateVirtualNetworkForm)1 VirtualNetwork (com.microsoft.tooling.msservices.model.vm.VirtualNetwork)1