use of org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterListModel in project ovirt-engine by oVirt.
the class DataCenterModule method getDataCenterStorageListProvider.
// Search-able Detail Models
@Provides
@Singleton
public SearchableDetailModelProvider<StorageDomain, DataCenterListModel, DataCenterStorageListModel> getDataCenterStorageListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<FindSingleStoragePopupPresenterWidget> singlePopupProvider, final Provider<FindMultiStoragePopupPresenterWidget> multiPopupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<DataCenterListModel> mainModelProvider, final Provider<DataCenterStorageListModel> modelProvider) {
SearchableDetailTabModelProvider<StorageDomain, DataCenterListModel, DataCenterStorageListModel> result = new SearchableDetailTabModelProvider<StorageDomain, DataCenterListModel, DataCenterStorageListModel>(eventBus, defaultConfirmPopupProvider) {
@Override
public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(DataCenterStorageListModel source, UICommand lastExecutedCommand, Model windowModel) {
DataCenterStorageListModel model = getModel();
if (lastExecutedCommand == model.getAttachStorageCommand()) {
return multiPopupProvider.get();
} else if (lastExecutedCommand == model.getAttachISOCommand() || lastExecutedCommand == model.getAttachBackupCommand()) {
return singlePopupProvider.get();
} else {
return super.getModelPopup(source, lastExecutedCommand, windowModel);
}
}
@Override
public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(DataCenterStorageListModel 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.datacenters.DataCenterListModel in project ovirt-engine by oVirt.
the class DataCenterSubTabPanelPresenter method initDetailTabToModelMapping.
@Override
protected void initDetailTabToModelMapping(Map<TabData, Model> mapping) {
DataCenterListModel mainModel = modelProvider.getModel();
mapping.put(DetailTabDataIndex.DATACENTER_STORAGE, mainModel.getStorageListModel());
mapping.put(DetailTabDataIndex.DATACENTER_NETWORKS, mainModel.getNetworkListModel());
mapping.put(DetailTabDataIndex.DATACENTER_ISCSI_MULTIPATHING, mainModel.getIscsiBondListModel());
mapping.put(DetailTabDataIndex.DATACENTER_CLUSTERS, mainModel.getClusterListModel());
mapping.put(DetailTabDataIndex.DATACENTER_QOS, mainModel.getStorageQosListModel());
mapping.put(DetailTabDataIndex.DATACENTER_QUOTA, mainModel.getQuotaListModel());
mapping.put(DetailTabDataIndex.DATACENTER_PERMISSIONS, mainModel.getPermissionListModel());
mapping.put(DetailTabDataIndex.DATACENTER_EVENTS, mainModel.getEventListModel());
}
Aggregations