use of org.ovirt.engine.core.common.action.ActionParametersBase 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.core.common.action.ActionParametersBase 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.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class MoveOrCopyDiskModel method getParameters.
protected ArrayList<ActionParametersBase> getParameters() {
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (DiskModel diskModel : getDisks()) {
StorageDomain destStorageDomain = diskModel.getStorageDomain().getSelectedItem();
StorageDomain sourceStorageDomain = diskModel.getSourceStorageDomain().getSelectedItem();
Guid sourceStorageDomainGuid = sourceStorageDomain != null ? sourceStorageDomain.getId() : Guid.Empty;
DiskImage disk = (DiskImage) diskModel.getDisk();
DiskProfile diskProfile = diskModel.getDiskProfile().getSelectedItem();
disk.setDiskProfileId(diskProfile != null ? diskProfile.getId() : null);
disk.setDiskAlias(diskModel.getAlias().getEntity());
if (diskModel.getQuota().getSelectedItem() != null) {
disk.setQuotaId(diskModel.getQuota().getSelectedItem().getId());
}
if (destStorageDomain == null || sourceStorageDomain == null) {
continue;
}
Guid destStorageDomainGuid = destStorageDomain.getId();
addMoveOrCopyParameters(parameters, sourceStorageDomainGuid, destStorageDomainGuid, disk);
}
return parameters;
}
use of org.ovirt.engine.core.common.action.ActionParametersBase 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());
}
use of org.ovirt.engine.core.common.action.ActionParametersBase in project ovirt-engine by oVirt.
the class RemoveProfileModel method onRemove.
private void onRemove() {
if (getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> actionParametersBaseList = new ArrayList<>();
for (P profile : getProfiles()) {
ActionParametersBase parameters = getRemoveProfileParams(profile);
actionParametersBaseList.add(parameters);
}
startProgress();
Frontend.getInstance().runMultipleAction(getRemoveActionType(), actionParametersBaseList, result -> {
stopProgress();
cancel();
}, null);
}
Aggregations