use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class PoolListModel method onRemove.
public void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object item : getSelectedItems()) {
VmPool pool = (VmPool) item;
list.add(new VmPoolParametersBase(pool.getVmPoolId()));
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveVmPool, list, 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 QuotaUserListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeQuotaAssignmentFromUsersTitle());
model.setHelpTag(HelpTag.remove_quota_assignment_from_user);
// $NON-NLS-1$
model.setHashName("remove_quota_assignment_from_user");
ArrayList<String> list = new ArrayList<>();
for (Permission item : getSelectedItems()) {
list.add(item.getOwnerName());
}
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 QuotaUserListModel method onRemove.
private void onRemove() {
if (getSelectedItems() != null && getSelectedItems().size() > 0) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object perm : getSelectedItems()) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
tempVar.setPermission((Permission) perm);
list.add(tempVar);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemovePermission, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
cancel();
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class ManageBackupModel method validateSingleArchitecture.
protected boolean validateSingleArchitecture() {
// Checks if there are selected VMs of multiple architectures
ArchitectureType firstArch = null;
boolean multipleArchs = false;
for (T item : getSelectedItems()) {
ArchitectureType arch = getArchitectureFromItem(item);
if (firstArch == null) {
firstArch = arch;
} else {
if (!firstArch.equals(arch)) {
multipleArchs = true;
break;
}
}
}
if (multipleArchs) {
ConfirmationModel confirmModel = new ConfirmationModel();
setConfirmWindow(confirmModel);
confirmModel.setTitle(ConstantsManager.getInstance().getConstants().invalidImportTitle());
confirmModel.setHelpTag(HelpTag.multiple_archs_dialog);
// $NON-NLS-1$
confirmModel.setHashName("multiple_archs_dialog");
confirmModel.setMessage(ConstantsManager.getInstance().getConstants().invalidImportMsg());
// $NON-NLS-1$
UICommand command = UICommand.createDefaultOkUiCommand("multipleArchsOK", this);
confirmModel.getCommands().add(command);
setConfirmWindow(confirmModel);
return false;
}
return true;
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class ProviderSecretListModel method onRemoveSecret.
private void onRemoveSecret() {
ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (LibvirtSecret libvirtSecret : getSelectedItems()) {
LibvirtSecretParameters param = new LibvirtSecretParameters(libvirtSecret);
parameters.add(param);
}
Frontend.getInstance().runMultipleAction(ActionType.RemoveLibvirtSecret, parameters, result -> cancel());
}
Aggregations