use of com.microsoft.azure.toolkit.lib.common.bundle.AzureString in project azure-tools-for-java by Microsoft.
the class SelectImageStep method fillSkus.
private void fillSkus() {
disableNext();
if (offerComboBox.getItemCount() > 0) {
final VirtualMachineOffer offer = (VirtualMachineOffer) offerComboBox.getSelectedItem();
final AzureString title = AzureOperationBundle.title("vm|sku.list", offer.name());
AzureTaskManager.getInstance().runInBackground(new AzureTask(project, title, false, () -> {
final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
progressIndicator.setIndeterminate(true);
RxJavaUtils.unsubscribeSubscription(fillSkuSubscription);
clearSelection(skuComboBox, imageLabelList);
fillSkuSubscription = Observable.fromCallable(() -> offer.skus().list()).subscribeOn(Schedulers.io()).subscribe(skuList -> DefaultLoader.getIdeHelper().invokeLater(() -> {
skuComboBox.setModel(new DefaultComboBoxModel(skuList.toArray()));
fillImages();
}), error -> {
String msg = String.format(ERROR_MESSAGE_FILL_SKUS, String.format(message("webappExpMsg"), error.getMessage()));
handleError(msg, error);
});
}));
} else {
skuComboBox.removeAllItems();
imageLabelList.setListData(new Object[] {});
}
}
Aggregations