use of com.microsoft.azuretools.authmanage.ISubscriptionSelectionListener in project azure-tools-for-java by Microsoft.
the class AzureModule method addSubscriptionSelectionListener.
private void addSubscriptionSelectionListener() {
try {
AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
// not signed in
if (azureManager == null) {
return;
}
azureManager.getSubscriptionManager().addListener(new ISubscriptionSelectionListener() {
@Override
public void update(boolean isRefresh) {
if (!isRefresh) {
handleSubscriptionChange();
}
}
});
} catch (Exception ex) {
DefaultLoader.getUIHelper().logError(ex.getMessage(), ex);
}
}
use of com.microsoft.azuretools.authmanage.ISubscriptionSelectionListener in project azure-tools-for-java by Microsoft.
the class BlobExplorerFileEditor method addSubscriptionSelectionListener.
private void addSubscriptionSelectionListener() {
try {
AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
// not signed in
if (azureManager == null) {
return;
}
azureManager.getSubscriptionManager().addListener(new ISubscriptionSelectionListener() {
@Override
public void update(boolean isSignedOut) {
if (isSignedOut) {
Object openedFile = DefaultLoader.getUIHelper().getOpenedFile(project, storageAccount, blobContainer);
if (openedFile != null) {
DefaultLoader.getIdeHelper().closeFile(project, openedFile);
}
}
}
});
} catch (Exception ex) {
DefaultLoader.getUIHelper().logError(ex.getMessage(), ex);
}
}
Aggregations