use of org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel 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;
}
use of org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel in project ovirt-engine by oVirt.
the class StorageSubTabPanelPresenter method initDetailTabToModelMapping.
@Override
protected void initDetailTabToModelMapping(Map<TabData, Model> mapping) {
StorageListModel mainModel = modelProvider.getModel();
mapping.put(DetailTabDataIndex.STORAGE_GENERAL, mainModel.getGeneralModel());
mapping.put(DetailTabDataIndex.STORAGE_DATA_CENTER, mainModel.getDcListModel());
mapping.put(DetailTabDataIndex.STORAGE_REGISTER_VMS, mainModel.getVmRegisterListModel());
mapping.put(DetailTabDataIndex.STORAGE_VM_BACKUP, mainModel.getVmBackupModel());
mapping.put(DetailTabDataIndex.STORAGE_REGISTER_TEMPLATES, mainModel.getTemplateRegisterListModel());
mapping.put(DetailTabDataIndex.STORAGE_TEMPLATE_BACKUP, mainModel.getTemplateBackupModel());
mapping.put(DetailTabDataIndex.STORAGE_REGISTER_DISK_IMAGE, mainModel.getDiskImageRegisterListModel());
mapping.put(DetailTabDataIndex.STORAGE_VMS, mainModel.getVmListModel());
mapping.put(DetailTabDataIndex.STORAGE_TEMPLATES, mainModel.getTemplateListModel());
mapping.put(DetailTabDataIndex.STORAGE_IMAGES, mainModel.getIsoListModel());
mapping.put(DetailTabDataIndex.STORAGE_DISKS, mainModel.getDiskListModel());
mapping.put(DetailTabDataIndex.STORAGE_SNAPSHOTS, mainModel.getSnapshotListModel());
mapping.put(DetailTabDataIndex.STORAGE_REGISTER_DISKS, mainModel.getRegisterDiskListModel());
mapping.put(DetailTabDataIndex.STORAGE_LEASE, mainModel.getLeaseListModel());
mapping.put(DetailTabDataIndex.STORAGE_DISK_PROFILES, mainModel.getDiskProfileListModel());
mapping.put(DetailTabDataIndex.STORAGE_DR, mainModel.getDRListModel());
mapping.put(DetailTabDataIndex.STORAGE_EVENTS, mainModel.getEventListModel());
mapping.put(DetailTabDataIndex.STORAGE_PERMISSIONS, mainModel.getPermissionListModel());
}
Aggregations