use of com.microsoft.tooling.msservices.serviceexplorer.azure.storage.StorageModule in project azure-tools-for-java by Microsoft.
the class ModifyExternalStorageAccountAction method actionPerformed.
@Override
public void actionPerformed(NodeActionEvent e) {
final ExternalStorageAccountForm form = new ExternalStorageAccountForm((Project) storageNode.getProject());
form.setTitle("Modify External Storage Account");
for (ClientStorageAccount account : ExternalStorageHelper.getList(storageNode.getProject())) {
if (account.getName().equals(storageNode.getClientStorageAccount().getName())) {
form.setStorageAccount(account);
}
}
form.setOnFinish(new Runnable() {
@Override
public void run() {
ClientStorageAccount oldStorageAccount = storageNode.getClientStorageAccount();
ClientStorageAccount storageAccount = StorageClientSDKManager.getManager().getStorageAccount(form.getStorageAccount().getConnectionString());
ClientStorageAccount fullStorageAccount = form.getFullStorageAccount();
StorageModule parent = (StorageModule) storageNode.getParent();
parent.removeDirectChildNode(storageNode);
parent.addChildNode(new ExternalStorageNode(parent, fullStorageAccount));
ExternalStorageHelper.detach(oldStorageAccount);
ExternalStorageHelper.add(form.getStorageAccount());
}
});
form.show();
}
Aggregations