Search in sources :

Example 1 with StorageListModel

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;
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) StorageListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel) StorageDataCenterListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel) TemplateBackupModel(org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel) StorageTemplateListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel) DiskProfileListModel(org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel) StorageDataCenterListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel) StorageSnapshotListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageSnapshotListModel) StorageRegisterDiskListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterDiskListModel) StorageRegisterVmListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterVmListModel) StorageVmListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel) StorageRegisterTemplateListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterTemplateListModel) StorageEventListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageEventListModel) StorageLeaseListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageLeaseListModel) VmBackupModel(org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) StorageRegisterDiskImageListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterDiskImageListModel) StorageDiskListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel) StorageListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) StorageDRListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageDRListModel) StorageIsoListModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel) ImportCloneModel(org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel) StorageGeneralModel(org.ovirt.engine.ui.uicommonweb.models.storage.StorageGeneralModel) 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 StorageListModel

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

Aggregations

StorageListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel)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 DiskProfileListModel (org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel)1 ImportCloneModel (org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel)1 StorageDRListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageDRListModel)1 StorageDataCenterListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel)1 StorageDiskListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel)1 StorageEventListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageEventListModel)1 StorageGeneralModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageGeneralModel)1 StorageIsoListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel)1 StorageLeaseListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageLeaseListModel)1 StorageRegisterDiskImageListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterDiskImageListModel)1 StorageRegisterDiskListModel (org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterDiskListModel)1