Search in sources :

Example 96 with ConfirmationModel

use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel 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)

Example 97 with ConfirmationModel

use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel 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 98 with ConfirmationModel

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

the class HostInterfaceListModel method syncAllHostNetworks.

public void syncAllHostNetworks() {
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().syncAllHostNetworkConfirmationDialogTitle());
    model.setHelpTag(HelpTag.sync_all_host_networks);
    // $NON-NLS-1$
    model.setHashName("sync_all_host_networks");
    model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToSyncAllHostNetworksMsg());
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSyncAllHostNetworkConfirm", this);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 99 with ConfirmationModel

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

the class HostInterfaceListModel method onSyncAllHostNetworkConfirm.

private void onSyncAllHostNetworkConfirm() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    getWindow().startProgress();
    Frontend.getInstance().runAction(ActionType.SyncAllHostNetworks, new VdsActionParameters(getEntity().getId()), result -> {
        getWindow().stopProgress();
        cancel();
    }, null);
}
Also used : VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 100 with ConfirmationModel

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

the class HostInterfaceListModel method saveNetworkConfig.

public void saveNetworkConfig() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().saveNetworkConfigurationTitle());
    model.setHelpTag(HelpTag.save_network_configuration);
    // $NON-NLS-1$
    model.setHashName("save_network_configuration");
    model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantToMakeTheChangesPersistentMsg());
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSaveNetworkConfig", this);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Aggregations

ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)184 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)112 ArrayList (java.util.ArrayList)105 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)54 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)23 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)22 List (java.util.List)21 ActionType (org.ovirt.engine.core.common.action.ActionType)20 Frontend (org.ovirt.engine.ui.frontend.Frontend)20 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)20 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)20 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)20 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)18 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)17 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)17 VDS (org.ovirt.engine.core.common.businessentities.VDS)17 QueryType (org.ovirt.engine.core.common.queries.QueryType)17 Guid (org.ovirt.engine.core.compat.Guid)17 Model (org.ovirt.engine.ui.uicommonweb.models.Model)15 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)14