use of com.intellij.openapi.ui.ValidationInfo in project azure-tools-for-java by Microsoft.
the class AzureSelectDockerHostStep method onNext.
@Override
public WizardStep onNext(final AzureSelectDockerWizardModel model) {
if (dockerHostsTableSelection != null && doValidate() == null) {
return super.onNext(model);
} else {
setDialogButtonsState(false);
ValidationInfo info = new ValidationInfo("Please check a Docker host or create a new", dockerHostsTable);
model.getSelectDockerWizardDialog().DialogShaker(info);
return this;
}
}
use of com.intellij.openapi.ui.ValidationInfo in project azure-tools-for-java by Microsoft.
the class AzureNewDockerWizardModel method doValidate.
public ValidationInfo doValidate() {
ValidationInfo validationInfo = newDockerHostStep.doValidate();
if (validationInfo != null) {
finishedOK = false;
return validationInfo;
}
validationInfo = newDockerLoginStep.doValidate();
if (validationInfo != null) {
finishedOK = false;
return validationInfo;
}
finishedOK = true;
return null;
}
use of com.intellij.openapi.ui.ValidationInfo in project azure-tools-for-java by Microsoft.
the class AzureNewDockerHostStep method validateDockerVMSize.
private ValidationInfo validateDockerVMSize(boolean shakeOnError) {
// Docker virtual machine size
String vmSize = (String) dockerHostVMSizeComboBox.getSelectedItem();
if (vmSize == null || vmSize.isEmpty()) {
ValidationInfo info = AzureDockerUIResources.validateComponent("Virtual machine size not found", vmKindPanel, dockerHostVMSizeComboBox, null);
hostDetailsTabbedPane.setSelectedComponent(vmKindPanel);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
newHost.hostVM.vmSize = vmSize;
return null;
}
use of com.intellij.openapi.ui.ValidationInfo in project azure-tools-for-java by Microsoft.
the class AzureNewDockerHostStep method validateDockerVnet.
private ValidationInfo validateDockerVnet(boolean shakeOnError) {
// Docker virtual network name
if (dockerHostNewVNetRadioButton.isSelected()) {
// New virtual network
String vnetName = dockerHostNewVNetNameTextField.getText();
if (vnetName == null || vnetName.isEmpty() || !AzureDockerValidationUtils.validateDockerVnetName(vnetName)) {
ValidationInfo info = AzureDockerUIResources.validateComponent("Missing virtual network name", networkPanel, dockerHostNewVNetNameTextField, dockerHostNewVNetNameLabel);
hostDetailsTabbedPane.setSelectedComponent(networkPanel);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
String vnetAddrSpace = dockerHostNewVNetAddrSpaceTextField.getText();
if (vnetAddrSpace == null || vnetAddrSpace.isEmpty() || !AzureDockerValidationUtils.validateDockerVnetAddrSpace(vnetAddrSpace)) {
ValidationInfo info = AzureDockerUIResources.validateComponent("Missing virtual network address space", networkPanel, dockerHostNewVNetAddrSpaceTextField, dockerHostNewVNetAddrSpaceLabel);
hostDetailsTabbedPane.setSelectedComponent(networkPanel);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
newHost.hostVM.vnetName = vnetName;
newHost.hostVM.vnetAddressSpace = vnetAddrSpace;
newHost.hostVM.subnetName = "subnet1";
} else {
// Existing virtual network and subnet
AzureDockerVnet vnet = (AzureDockerVnet) dockerHostSelectVnetComboBox.getSelectedItem();
if (vnet == null || vnet.name == null || vnet.name.isEmpty()) {
ValidationInfo info = AzureDockerUIResources.validateComponent("Missing virtual network selection", networkPanel, dockerHostSelectVnetComboBox, null);
hostDetailsTabbedPane.setSelectedComponent(networkPanel);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
String subnet = (String) dockerHostSelectSubnetComboBox.getSelectedItem();
if (subnet == null || subnet.isEmpty()) {
hostDetailsTabbedPane.setSelectedComponent(networkPanel);
ValidationInfo info = AzureDockerUIResources.validateComponent("Missing subnet selection", networkPanel, dockerHostSelectSubnetComboBox, null);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
// Add "@resourceGroupName" to mark this as an existing virtual network
newHost.hostVM.vnetName = vnet.name + "@" + vnet.resourceGroup;
newHost.hostVM.vnetAddressSpace = vnet.addrSpace;
newHost.hostVM.subnetName = subnet;
}
return null;
}
use of com.intellij.openapi.ui.ValidationInfo in project azure-tools-for-java by Microsoft.
the class AzureNewDockerHostStep method validateDockerStorage.
private ValidationInfo validateDockerStorage(boolean shakeOnError) {
// Docker storage account
String vmSize = (String) dockerHostVMSizeComboBox.getSelectedItem();
String storageName;
if (dockerHostNewStorageRadioButton.isSelected()) {
// New storage account
storageName = dockerNewStorageTextField.getText();
if (storageName == null || storageName.isEmpty() || vmSize == null || vmSize.isEmpty() || !AzureDockerValidationUtils.validateDockerHostStorageName(storageName, (AzureDockerSubscription) dockerSubscriptionComboBox.getSelectedItem())) {
ValidationInfo info = AzureDockerUIResources.validateComponent("Missing storage account name", storagePanel, dockerNewStorageTextField, dockerNewStorageLabel);
hostDetailsTabbedPane.setSelectedComponent(storagePanel);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
newHost.hostVM.storageAccountName = storageName;
newHost.hostVM.storageAccountType = AzureDockerUtils.getStorageTypeForVMSize(vmSize);
} else {
// Existing resource group
storageName = (String) dockerSelectStorageComboBox.getSelectedItem();
if (storageName == null || storageName.isEmpty() || vmSize == null || vmSize.isEmpty()) {
ValidationInfo info = AzureDockerUIResources.validateComponent("Missing storage account selection", storagePanel, dockerSelectStorageComboBox, null);
hostDetailsTabbedPane.setSelectedComponent(storagePanel);
setDialogButtonsState(false);
if (shakeOnError) {
model.DialogShaker(info);
}
return info;
}
// Add "@" to mark this as an existing storage account
newHost.hostVM.storageAccountName = storageName + "@";
newHost.hostVM.storageAccountType = AzureDockerUtils.getStorageTypeForVMSize(vmSize);
}
setDialogButtonsState(true);
return null;
}
Aggregations