use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class PublishWebAppOnLinuxDialog method onSubscriptionSelection.
private void onSubscriptionSelection() {
cpNew.cbExistingResourceGroup.removeAll();
cpNew.cbLocation.removeAll();
Subscription sb = getSelectedSubscription();
if (sb != null) {
webAppOnLinuxDeployPresenter.onLoadResourceGroup(sb.getId());
webAppOnLinuxDeployPresenter.onLoadLocationList(sb.getId());
}
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class SelectImageStep method fillRegions.
private void fillRegions() {
regionComboBox.removeAll();
Subscription subs = wizard.getSubscription();
List<Region> locations = Azure.az(AzureAccount.class).listRegions(subs.getId());
for (Region location : locations) {
regionComboBox.add(location.getLabel());
regionComboBox.setData(location.getLabel(), location);
}
if (locations.size() > 0) {
regionComboBox.select(0);
selectRegion();
}
regionComboBox.setEnabled(true);
validateNext();
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class AppInsightsMngmtPanel method loadInfoFirstTime.
private void loadInfoFirstTime() {
try {
if (AuthMethodManager.getInstance().isSignedIn()) {
AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
List<Subscription> subList = azureManager.getSelectedSubscriptions();
if (subList.size() > 0) {
updateApplicationInsightsResourceRegistry(subList, myProject);
} else {
// just show manually added list from preferences
// Neither clear subscription list nor show sign in dialog as user may just want to add key manually.
keeepManuallyAddedList(myProject);
}
} else {
// just show manually added list from preferences
keeepManuallyAddedList(myProject);
}
} catch (Exception ex) {
AzurePlugin.log(ex.getMessage(), ex);
}
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class AppServiceCreateDialog method fillResourceGroups.
protected void fillResourceGroups() {
Subscription selectedSubscription = getSelectedSubscription();
if (selectedSubscription == null) {
return;
}
setComboRefreshingStatus(comboResourceGroup, true);
Mono.fromCallable(() -> {
List<ResourceGroup> list = Azure.az(AzureGroup.class).list(selectedSubscription.getId(), false);
list.sort(Comparator.comparing(ResourceGroup::getName));
return list;
}).subscribeOn(Schedulers.boundedElastic()).subscribe(groupList -> {
binderResourceGroup = new ArrayList<>();
DefaultLoader.getIdeHelper().invokeLater(() -> {
comboResourceGroup.removeAll();
for (ResourceGroup rg : groupList) {
comboResourceGroup.add(rg.getName());
binderResourceGroup.add(rg);
}
if (comboResourceGroup.getItemCount() > 0) {
comboResourceGroup.select(0);
}
String resourceGroup = CommonUtils.getPreference(CommonUtils.RG_NAME);
CommonUtils.selectComboIndex(comboResourceGroup, resourceGroup);
});
});
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class AppServiceCreateDialog method fillSubscriptions.
private void fillSubscriptions() {
try {
List<Subscription> selectedSubscriptions = Azure.az(AzureAccount.class).account().getSelectedSubscriptions();
// reset model
if (selectedSubscriptions == null) {
return;
}
comboSubscription.removeAll();
binderSubscriptionDetails = new ArrayList<>();
for (Subscription sd : selectedSubscriptions) {
comboSubscription.add(sd.getName());
binderSubscriptionDetails.add(sd);
}
if (comboSubscription.getItemCount() > 0) {
comboSubscription.select(0);
}
String subscription = CommonUtils.getPreference(CommonUtils.SUBSCRIPTION);
CommonUtils.selectComboIndex(comboSubscription, subscription);
} catch (Exception ex) {
ex.printStackTrace();
LOG.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "doFillSubscriptions@AppServiceCreateDialog", ex));
}
}
Aggregations