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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations