use of org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel in project ovirt-engine by oVirt.
the class StorageModule method getStorageDataCenterListProvider.
// Searchable Detail Models
@Provides
@Singleton
public SearchableDetailModelProvider<StorageDomain, StorageListModel, StorageDataCenterListModel> getStorageDataCenterListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<FindSingleDcPopupPresenterWidget> singlePopupProvider, final Provider<FindMultiDcPopupPresenterWidget> multiPopupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<StorageListModel> mainModelProvider, final Provider<StorageDataCenterListModel> modelProvider) {
SearchableDetailTabModelProvider<StorageDomain, StorageListModel, StorageDataCenterListModel> result = new SearchableDetailTabModelProvider<StorageDomain, StorageListModel, StorageDataCenterListModel>(eventBus, defaultConfirmPopupProvider) {
@Override
public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(StorageDataCenterListModel source, UICommand lastExecutedCommand, Model windowModel) {
StorageDataCenterListModel model = getModel();
if (lastExecutedCommand == model.getAttachCommand()) {
if (model.getAttachMultiple()) {
return multiPopupProvider.get();
} else {
return singlePopupProvider.get();
}
} else {
return super.getModelPopup(source, lastExecutedCommand, windowModel);
}
}
@Override
public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(StorageDataCenterListModel source, UICommand lastExecutedCommand) {
if (lastExecutedCommand == getModel().getDetachCommand() || lastExecutedCommand.getName().equals("OnAttach")) {
// $NON-NLS-1$) {
return removeConfirmPopupProvider.get();
} else if (lastExecutedCommand == getModel().getMaintenanceCommand() || lastExecutedCommand.getName().equals("OnMaintenance")) {
// $NON-NLS-1$) {
return removeConfirmPopupProvider.get();
} else {
return super.getConfirmModelPopup(source, lastExecutedCommand);
}
}
};
result.setMainModelProvider(mainModelProvider);
result.setModelProvider(modelProvider);
return result;
}
Aggregations