Search in sources :

Example 11 with ConfirmationModel

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

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

the class AffinityLabelListModel method onRemove.

private void onRemove() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    for (Label affinityLabel : getSelectedItems()) {
        parameters.add(new LabelActionParameters(affinityLabel));
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveLabel, parameters, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : LabelActionParameters(org.ovirt.engine.core.common.action.LabelActionParameters) ArrayList(java.util.ArrayList) Label(org.ovirt.engine.core.common.businessentities.Label) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 13 with ConfirmationModel

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

the class RoleListModel method remove.

public void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removeRolesTitle());
    model.setHelpTag(HelpTag.remove_role);
    // $NON-NLS-1$
    model.setHashName("remove_role");
    ArrayList<String> list = new ArrayList<>();
    for (Role role : getSelectedItems()) {
        list.add(role.getName());
    }
    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);
}
Also used : Role(org.ovirt.engine.core.common.businessentities.Role) ArrayList(java.util.ArrayList) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 14 with ConfirmationModel

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

the class RolePermissionListModel method remove.

private void remove() {
    if (getWindow() != null) {
        return;
    }
    ConfirmationModel model = new ConfirmationModel();
    setWindow(model);
    model.setTitle(ConstantsManager.getInstance().getConstants().removePermissionTitle());
    model.setHelpTag(HelpTag.remove_permission);
    // $NON-NLS-1$
    model.setHashName("remove_permission");
    model.setItems(getSelectedItems());
    // $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);
}
Also used : UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)

Example 15 with ConfirmationModel

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

the class AffinityGroupListModel method onRemove.

private void onRemove() {
    ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
    if (model.getProgress() != null) {
        return;
    }
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    for (AffinityGroup affinityGroup : getSelectedItems()) {
        parameters.add(new AffinityGroupCRUDParameters(affinityGroup.getId(), affinityGroup));
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.RemoveAffinityGroup, parameters, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : ArrayList(java.util.ArrayList) AffinityGroupCRUDParameters(org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) AffinityGroup(org.ovirt.engine.core.common.scheduling.AffinityGroup)

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