Search in sources :

Example 1 with SubscriptionsDialog

use of com.microsoft.azuretools.ijidea.ui.SubscriptionsDialog in project azure-tools-for-java by Microsoft.

the class SelectSubscriptionsAction method onShowSubscriptions.

public static void onShowSubscriptions(Project project) {
    JFrame frame = WindowManager.getInstance().getFrame(project);
    try {
        //Project project = ProjectManager.getInstance().getDefaultProject();();
        AzureManager manager = AuthMethodManager.getInstance().getAzureManager();
        if (manager == null) {
            return;
        }
        final SubscriptionManager subscriptionManager = manager.getSubscriptionManager();
        updateSubscriptionWithProgressDialog(subscriptionManager, project);
        List<SubscriptionDetail> sdl = subscriptionManager.getSubscriptionDetails();
        for (SubscriptionDetail sd : sdl) {
            System.out.println(sd.getSubscriptionName());
        }
        //System.out.println("onShowSubscriptions: calling getSubscriptionDetails()");
        SubscriptionsDialog d = SubscriptionsDialog.go(subscriptionManager.getSubscriptionDetails(), project);
        List<SubscriptionDetail> subscriptionDetailsUpdated;
        if (d != null) {
            subscriptionDetailsUpdated = d.getSubscriptionDetails();
            subscriptionManager.setSubscriptionDetails(subscriptionDetailsUpdated);
        }
    } catch (Exception ex) {
        ex.printStackTrace();
        //LOGGER.error("onShowSubscriptions", ex);
        ErrorWindow.show(project, ex.getMessage(), "Select Subscriptions Action Error");
    }
}
Also used : AzureManager(com.microsoft.azuretools.sdkmanage.AzureManager) SubscriptionDetail(com.microsoft.azuretools.authmanage.models.SubscriptionDetail) SubscriptionsDialog(com.microsoft.azuretools.ijidea.ui.SubscriptionsDialog) SubscriptionManager(com.microsoft.azuretools.authmanage.SubscriptionManager)

Aggregations

SubscriptionManager (com.microsoft.azuretools.authmanage.SubscriptionManager)1 SubscriptionDetail (com.microsoft.azuretools.authmanage.models.SubscriptionDetail)1 SubscriptionsDialog (com.microsoft.azuretools.ijidea.ui.SubscriptionsDialog)1 AzureManager (com.microsoft.azuretools.sdkmanage.AzureManager)1