Search in sources :

Example 1 with DataCenterListModel

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;
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) DataCenterListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterListModel) DataCenterIscsiBondListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterIscsiBondListModel) DataCenterQuotaListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterQuotaListModel) DataCenterListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterListModel) DataCenterNetworkListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel) DataCenterStorageListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterStorageListModel) DataCenterCpuQosListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterCpuQosListModel) NewHostNetworkQosModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) DataCenterClusterListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterClusterListModel) DataCenterHostNetworkQosListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterHostNetworkQosListModel) DataCenterStorageQosListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterStorageQosListModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) DataCenterNetworkQoSListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkQoSListModel) DataCenterEventListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterEventListModel) DataCenterStorageListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterStorageListModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) SearchableDetailTabModelProvider(org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Example 2 with DataCenterListModel

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());
}
Also used : DataCenterListModel(org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterListModel)

Aggregations

DataCenterListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterListModel)2 Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)1 SearchableDetailTabModelProvider (org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider)1 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1 Model (org.ovirt.engine.ui.uicommonweb.models.Model)1 PermissionListModel (org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel)1 DataCenterClusterListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterClusterListModel)1 DataCenterEventListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterEventListModel)1 DataCenterIscsiBondListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterIscsiBondListModel)1 DataCenterNetworkListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel)1 DataCenterNetworkQoSListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkQoSListModel)1 DataCenterQuotaListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterQuotaListModel)1 DataCenterStorageListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterStorageListModel)1 DataCenterCpuQosListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterCpuQosListModel)1 DataCenterHostNetworkQosListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterHostNetworkQosListModel)1 DataCenterStorageQosListModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterStorageQosListModel)1 NewHostNetworkQosModel (org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.NewHostNetworkQosModel)1