Search in sources :

Example 1 with VmInterfaceListModel

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

the class VirtualMachineModule method getVmInterfaceListProvider.

@Provides
@Singleton
public SearchableDetailModelProvider<VmNetworkInterface, VmListModel<Void>, VmInterfaceListModel> getVmInterfaceListProvider(EventBus eventBus, Provider<DefaultConfirmationPopupPresenterWidget> defaultConfirmPopupProvider, final Provider<VmInterfacePopupPresenterWidget> popupProvider, final Provider<RemoveConfirmationPopupPresenterWidget> removeConfirmPopupProvider, final Provider<VmListModel<Void>> mainModelProvider, final Provider<VmInterfaceListModel> modelProvider) {
    SearchableDetailTabModelProvider<VmNetworkInterface, VmListModel<Void>, VmInterfaceListModel> result = new SearchableDetailTabModelProvider<VmNetworkInterface, VmListModel<Void>, VmInterfaceListModel>(eventBus, defaultConfirmPopupProvider) {

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

        @Override
        public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(VmInterfaceListModel source, UICommand lastExecutedCommand) {
            if (lastExecutedCommand == getModel().getRemoveCommand()) {
                return removeConfirmPopupProvider.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) VmInterfaceListModel(org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceListModel) VmNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface) 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) 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 VmNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface)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