use of com.microsoft.azuretools.azureexplorer.forms.CreateArmStorageAccountForm in project azure-tools-for-java by Microsoft.
the class CreateArmStorageAccountAction method actionPerformed.
@Override
public void actionPerformed(NodeActionEvent e) {
SignInCommandHandler.requireSignedIn(PluginUtil.getParentShell(), () -> {
CreateArmStorageAccountForm createStorageAccountForm = new CreateArmStorageAccountForm(PluginUtil.getParentShell(), null, null);
createStorageAccountForm.setOnCreate(() -> {
AzureTaskManager.getInstance().runInBackground("Creating storage account " + createStorageAccountForm.getStorageAccount().getName() + "...", new Runnable() {
@Override
public void run() {
EventUtil.executeWithLog(STORAGE, CREATE_STORAGE_ACCOUNT, (operation) -> {
createStorageAccount(createStorageAccountForm.getStorageAccount());
storageModule.load(false);
}, (e) -> AzureTaskManager.getInstance().runLater(() -> PluginUtil.displayErrorDialog(PluginUtil.getParentShell(), Messages.err, "An error occurred while creating the storage account: " + e.getMessage())));
}
});
});
createStorageAccountForm.open();
});
}
use of com.microsoft.azuretools.azureexplorer.forms.CreateArmStorageAccountForm in project azure-tools-for-java by Microsoft.
the class SettingsStep method showNewStorageForm.
private void showNewStorageForm() {
final CreateArmStorageAccountForm form = new CreateArmStorageAccountForm(PluginUtil.getParentShell(), wizard.getSubscription(), wizard.getRegion());
form.setOnCreate(new Runnable() {
@Override
public void run() {
StorageAccountConfig newStorageAccount = form.getStorageAccount();
if (newStorageAccount != null) {
wizard.setNewStorageAccount(newStorageAccount);
wizard.setWithNewStorageAccount(true);
wizard.setStorageAccount(null);
AzureTaskManager.getInstance().runLater(() -> {
storageComboBox.add(newStorageAccount.getName() + " (New)", 0);
storageComboBox.select(0);
});
}
}
});
form.open();
}
Aggregations