Search in sources :

Example 66 with ConfirmationModel

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

the class DataCenterListModel method onForceRemove.

public void onForceRemove() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (!model.validate()) {
        return;
    }
    StoragePoolParametersBase tempVar = new StoragePoolParametersBase(getSelectedItem().getId());
    tempVar.setForceDelete(true);
    ActionParametersBase parametersBase = tempVar;
    Frontend.getInstance().runAction(ActionType.RemoveStoragePool, parametersBase);
    cancel();
}
Also used : ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) StoragePoolParametersBase(org.ovirt.engine.core.common.action.StoragePoolParametersBase) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 67 with ConfirmationModel

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

the class DataCenterListModel method remove.

public void remove() {
    if (getWindow() != null) {
        return;
    }
    boolean shouldAddressWarnning = false;
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeDataCenterTitle());
    model.setHelpTag(HelpTag.remove_data_center);
    // $NON-NLS-1$
    model.setHashName("remove_data_center");
    ArrayList<String> list = new ArrayList<>();
    for (StoragePool a : getSelectedItems()) {
        list.add(a.getName());
        // If one of the Data Centers contain Storage Domain, show the warnning.
        if (a.getStatus() != StoragePoolStatus.Uninitialized) {
            shouldAddressWarnning = true;
        }
    }
    model.setItems(list);
    // $NON-NLS-1$
    UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this);
    model.getCommands().add(tempVar);
    // $NON-NLS-1$
    UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this);
    model.getCommands().add(tempVar2);
    if (shouldAddressWarnning) {
        model.setNote(ConstantsManager.getInstance().getConstants().removeDataCenterWarnningNote());
    }
}
Also used : StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 68 with ConfirmationModel

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

the class DataCenterNetworkListModel method remove.

public void remove() {
    if (getConfirmWindow() != null) {
        return;
    }
    ConfirmationModel model = new RemoveNetworksModel(this);
    setConfirmWindow(model);
}
Also used : ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 69 with ConfirmationModel

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

the class DataCenterNetworkQoSListModel method remove.

public void remove() {
    if (getConfirmWindow() != null) {
        return;
    }
    ConfirmationModel model = new RemoveNetworkQoSModel(this);
    setConfirmWindow(model);
}
Also used : ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 70 with ConfirmationModel

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

the class DataCenterStorageListModel method postDetach.

public void postDetach(Model model) {
    Frontend.getInstance().runMultipleAction(ActionType.RemoveStorageDomain, getRemoveParams(), outerResult -> {
        Object[] array = (Object[]) outerResult.getState();
        ConfirmationModel localModel1 = (ConfirmationModel) array[0];
        List<ActionParametersBase> parameters = (List<ActionParametersBase>) array[1];
        Frontend.getInstance().runMultipleAction(ActionType.DetachStorageDomainFromPool, parameters, innerResult -> {
            ConfirmationModel localModel2 = (ConfirmationModel) innerResult.getState();
            localModel2.stopProgress();
            cancel();
        }, localModel1);
    }, new Object[] { model, getDetachParams() });
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

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