Search in sources :

Example 1 with VmTemplateManagementParameters

use of org.ovirt.engine.core.common.action.VmTemplateManagementParameters in project ovirt-engine by oVirt.

the class InstanceTypeListModel method onDeleteInstanceType.

private void onDeleteInstanceType() {
    final ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    boolean latchChecked = !model.validate();
    if (model.getProgress() != null || latchChecked) {
        return;
    }
    model.startProgress();
    Guid instanceTypeId = getSelectedItem().getId();
    Frontend.getInstance().runAction(ActionType.RemoveVmTemplate, new VmTemplateManagementParameters(instanceTypeId), result -> {
        model.stopProgress();
        cancel();
    }, this);
}
Also used : ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) Guid(org.ovirt.engine.core.compat.Guid) VmTemplateManagementParameters(org.ovirt.engine.core.common.action.VmTemplateManagementParameters)

Example 2 with VmTemplateManagementParameters

use of org.ovirt.engine.core.common.action.VmTemplateManagementParameters in project ovirt-engine by oVirt.

the class TemplateListModel method onRemove.

private void onRemove() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VmTemplate a = (VmTemplate) item;
        list.add(new VmTemplateManagementParameters(a.getId()));
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveVmTemplate, list, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : VmTemplate(org.ovirt.engine.core.common.businessentities.VmTemplate) ArrayList(java.util.ArrayList) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) VmTemplateManagementParameters(org.ovirt.engine.core.common.action.VmTemplateManagementParameters)

Aggregations

VmTemplateManagementParameters (org.ovirt.engine.core.common.action.VmTemplateManagementParameters)2 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)2 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)1 Guid (org.ovirt.engine.core.compat.Guid)1