Search in sources :

Example 1 with VmDiskListModel

use of org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel in project ovirt-engine by oVirt.

the class VirtualMachineModule method getVmDiskListProvider.

@Provides
@Singleton
public SearchableDetailModelProvider<Disk, VmListModel<Void>, VmDiskListModel> getVmDiskListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<VmDiskPopupPresenterWidget> popupProvider, final Provider<VmDiskAttachPopupPresenterWidget> attachPopupProvider, final Provider<VmDiskRemovePopupPresenterWidget> removeConfirmPopupProvider, final Provider<VmDiskSparsifyPopupPresenterWidget> sparsifyConfirmPopupProvider, final Provider<DisksAllocationPopupPresenterWidget> movePopupProvider, final Provider<ChangeQuotaPopupPresenterWidget> changeQutoaPopupProvider, final Provider<VmListModel<Void>> mainModelProvider, final Provider<VmDiskListModel> modelProvider) {
    SearchableDetailTabModelProvider<Disk, VmListModel<Void>, VmDiskListModel> result = new SearchableDetailTabModelProvider<Disk, VmListModel<Void>, VmDiskListModel>(eventBus, defaultConfirmPopupProvider) {

        @Override
        public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(VmDiskListModel source, UICommand lastExecutedCommand, Model windowModel) {
            VmDiskListModel model = getModel();
            if (lastExecutedCommand == model.getNewCommand() || lastExecutedCommand == model.getEditCommand()) {
                return popupProvider.get();
            } else if (lastExecutedCommand == getModel().getAttachCommand()) {
                return attachPopupProvider.get();
            } else if (lastExecutedCommand == getModel().getMoveCommand()) {
                return movePopupProvider.get();
            } else if (lastExecutedCommand == getModel().getChangeQuotaCommand()) {
                return changeQutoaPopupProvider.get();
            } else {
                return super.getModelPopup(source, lastExecutedCommand, windowModel);
            }
        }

        @Override
        public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(VmDiskListModel source, UICommand lastExecutedCommand) {
            if (lastExecutedCommand == getModel().getRemoveCommand()) {
                return removeConfirmPopupProvider.get();
            } else if (lastExecutedCommand == getModel().getSparsifyCommand()) {
                return sparsifyConfirmPopupProvider.get();
            } else {
                return super.getConfirmModelPopup(source, lastExecutedCommand);
            }
        }
    };
    result.setMainModelProvider(mainModelProvider);
    result.setModelProvider(modelProvider);
    return result;
}
Also used : VmListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel) VmListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel) VmDevicesListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmDevicesListModel) VmAffinityGroupListModel(org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.list.VmAffinityGroupListModel) VmErrataCountModel(org.ovirt.engine.ui.uicommonweb.models.VmErrataCountModel) VmGuestInfoModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmGuestInfoModel) AttachDiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.AttachDiskModel) NewDiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel) VmInterfaceListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceListModel) ImportVmsModel(org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel) VmHighPerformanceConfigurationModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmHighPerformanceConfigurationModel) VncInfoModel(org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel) ImportVmFromExportDomainModel(org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel) VmDiskListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel) VmAffinityLabelListModel(org.ovirt.engine.ui.uicommonweb.models.configure.labels.list.VmAffinityLabelListModel) VmAppListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) EditDiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.EditDiskModel) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) VmSnapshotListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel) VmEventListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmEventListModel) VmGeneralModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel) Model(org.ovirt.engine.ui.uicommonweb.models.Model) VmGuestContainerListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmGuestContainerListModel) VmHostDeviceListModel(org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.VmHostDeviceListModel) ImportVmFromExternalProviderModel(org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExternalProviderModel) VmNextRunConfigurationModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel) VmErrataListModel(org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel) VmImportGeneralModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmImportGeneralModel) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk) VmDiskListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel) SearchableDetailTabModelProvider(org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)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 VmErrataCountModel (org.ovirt.engine.ui.uicommonweb.models.VmErrataCountModel)1 VmErrataListModel (org.ovirt.engine.ui.uicommonweb.models.VmErrataListModel)1 PermissionListModel (org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel)1 VmAffinityLabelListModel (org.ovirt.engine.ui.uicommonweb.models.configure.labels.list.VmAffinityLabelListModel)1 VmAffinityGroupListModel (org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.list.VmAffinityGroupListModel)1 AttachDiskModel (org.ovirt.engine.ui.uicommonweb.models.vms.AttachDiskModel)1 EditDiskModel (org.ovirt.engine.ui.uicommonweb.models.vms.EditDiskModel)1 ImportVmFromExportDomainModel (org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel)1 ImportVmFromExternalProviderModel (org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExternalProviderModel)1 ImportVmsModel (org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel)1 NewDiskModel (org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel)1 VmAppListModel (org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel)1 VmDevicesListModel (org.ovirt.engine.ui.uicommonweb.models.vms.VmDevicesListModel)1