use of org.ovirt.engine.ui.uicommonweb.models.vms.RemoveDiskModel in project ovirt-engine by oVirt.
the class DiskListModel method remove.
private void remove() {
if (getWindow() != null) {
return;
}
RemoveDiskModel model = new RemoveDiskModel();
setWindow(model);
model.initialize(null, getSelectedItems(), this);
model.getLatch().setIsAvailable(false);
}
use of org.ovirt.engine.ui.uicommonweb.models.vms.RemoveDiskModel in project ovirt-engine by oVirt.
the class DiskListModel method onRemove.
private void onRemove() {
RemoveDiskModel model = (RemoveDiskModel) getWindow();
ArrayList<ActionParametersBase> parameterList = new ArrayList<>();
for (Object item : getSelectedItems()) {
Disk disk = (Disk) item;
ActionParametersBase parameters = new RemoveDiskParameters(disk.getId());
parameterList.add(parameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveDisk, parameterList, result -> {
DiskListModel localModel = (DiskListModel) result.getState();
localModel.stopProgress();
cancel();
}, this);
}
use of org.ovirt.engine.ui.uicommonweb.models.vms.RemoveDiskModel in project ovirt-engine by oVirt.
the class StorageDiskListModel method remove.
private void remove() {
if (getWindow() != null) {
return;
}
RemoveDiskModel model = new RemoveDiskModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeDisksTitle());
model.setHelpTag(HelpTag.remove_disk);
// $NON-NLS-1$
model.setHashName("remove_disk");
model.getLatch().setIsAvailable(false);
List<DiskModel> items = new ArrayList<>();
for (Object item : getSelectedItems()) {
DiskImage disk = (DiskImage) item;
DiskModel diskModel = new DiskModel();
diskModel.setDisk(disk);
items.add(diskModel);
}
model.setItems(items);
// $NON-NLS-1$
UICommand onRemoveCommand = UICommand.createDefaultOkUiCommand("OnRemove", this);
model.getCommands().add(onRemoveCommand);
// $NON-NLS-1$
UICommand cancelCommand = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(cancelCommand);
}
use of org.ovirt.engine.ui.uicommonweb.models.vms.RemoveDiskModel in project ovirt-engine by oVirt.
the class StorageDiskListModel method onRemove.
private void onRemove() {
RemoveDiskModel model = (RemoveDiskModel) getWindow();
List<ActionParametersBase> paramerterList = new ArrayList<>();
for (Object item : getSelectedItems()) {
DiskImage disk = (DiskImage) item;
ActionParametersBase parameters = new RemoveDiskParameters(disk.getId(), getEntity().getId());
paramerterList.add(parameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveDisk, paramerterList, result -> {
StorageDiskListModel localModel = (StorageDiskListModel) result.getState();
localModel.stopProgress();
cancel();
}, this);
}
Aggregations