Search in sources :

Example 6 with ChangeQuotaModel

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

the class VmDiskListModel method onChangeQuota.

private void onChangeQuota() {
    ChangeQuotaModel model = (ChangeQuotaModel) getWindow();
    ArrayList<ActionParametersBase> paramerterList = new ArrayList<>();
    for (Object item : model.getItems()) {
        ChangeQuotaItemModel itemModel = (ChangeQuotaItemModel) item;
        DiskImage disk = itemModel.getEntity();
        ActionParametersBase parameters = new ChangeQuotaParameters(itemModel.getQuota().getSelectedItem().getId(), disk.getId(), itemModel.getStorageDomainId(), disk.getStoragePoolId());
        paramerterList.add(parameters);
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.ChangeQuotaForDisk, paramerterList, result -> cancel(), this);
}
Also used : ChangeQuotaParameters(org.ovirt.engine.core.common.action.ChangeQuotaParameters) ArrayList(java.util.ArrayList) ChangeQuotaModel(org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaModel) ChangeQuotaItemModel(org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaItemModel) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Aggregations

ArrayList (java.util.ArrayList)6 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)6 ChangeQuotaModel (org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaModel)6 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)3 ChangeQuotaParameters (org.ovirt.engine.core.common.action.ChangeQuotaParameters)3 ChangeQuotaItemModel (org.ovirt.engine.ui.uicommonweb.models.quota.ChangeQuotaItemModel)3 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)1