use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class TagListModel method onRemove.
public void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
model.startProgress();
Frontend.getInstance().runAction(ActionType.RemoveTag, new TagsActionParametersBase(getSelectedItem().getId()), result -> {
TagListModel tagListModel = (TagListModel) result.getState();
ActionReturnValue returnVal = result.getReturnValue();
boolean success = returnVal != null && returnVal.getSucceeded();
if (success) {
tagListModel.getSearchCommand().execute();
}
tagListModel.cancel();
tagListModel.stopProgress();
}, this);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class AbstractDiskModel method onForceSave.
private void onForceSave() {
ConfirmationModel confirmationModel = (ConfirmationModel) getConfirmWindow();
if (confirmationModel != null && !confirmationModel.validate()) {
return;
}
cancelConfirm();
getSanStorageModelBase().setForce(true);
onSave();
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class AbstractDiskModel method forceCreationWarning.
protected void forceCreationWarning(ArrayList<String> usedLunsMessages) {
ConfirmationModel confirmationModel = new ConfirmationModel();
setConfirmWindow(confirmationModel);
confirmationModel.setTitle(constants.forceStorageDomainCreation());
confirmationModel.setMessage(constants.lunsAlreadyPartOfSD());
confirmationModel.setHelpTag(HelpTag.force_lun_disk_creation);
// $NON-NLS-1$
confirmationModel.setHashName("force_lun_disk_creation");
confirmationModel.setItems(usedLunsMessages);
// $NON-NLS-1$
UICommand forceSaveCommand = new UICommand("OnForceSave", this);
forceSaveCommand.setTitle(constants.ok());
forceSaveCommand.setIsDefault(true);
confirmationModel.getCommands().add(forceSaveCommand);
// $NON-NLS-1$
UICommand cancelconfirmCommand = new UICommand("CancelConfirm", this);
cancelconfirmCommand.setTitle(constants.cancel());
cancelconfirmCommand.setIsCancel(true);
confirmationModel.getCommands().add(cancelconfirmCommand);
}
use of org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel in project ovirt-engine by oVirt.
the class UserListModel method remove.
public void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeUsersTitle());
model.setHelpTag(HelpTag.remove_user);
// $NON-NLS-1$
model.setHashName("remove_user");
ArrayList<String> list = new ArrayList<>();
for (DbUser item : getSelectedItems()) {
list.add(item.getFirstName());
}
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 UserPermissionListModel 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);
} else {
cancel();
}
}
Aggregations