use of org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel in project ovirt-engine by oVirt.
the class TemplateStorageListModel method remove.
private void remove() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeTemplateDisksTitle());
model.setHelpTag(HelpTag.remove_template_disks);
// $NON-NLS-1$
model.setHashName("remove_template_disks");
List<? extends Object> disks = getSelectedItems() != null ? getSelectedItems() : new ArrayList<DiskModel>();
List<String> items = new ArrayList<>();
for (Object o : disks) {
DiskModel diskModel = (DiskModel) o;
items.add(ConstantsManager.getInstance().getMessages().templateDiskDescription(diskModel.getDisk().getDiskAlias(), diskModel.getStorageDomain().getSelectedItem().getStorageName()));
}
model.setItems(items);
// $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.vms.DiskModel in project ovirt-engine by oVirt.
the class TemplateStorageListModel method onRemove.
private void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
List<ActionParametersBase> parameters = new ArrayList<>();
List<? extends Object> disks = getSelectedItems() != null ? getSelectedItems() : new ArrayList<DiskModel>();
for (Object o : disks) {
DiskModel diskModel = (DiskModel) o;
RemoveDiskParameters params = new RemoveDiskParameters(diskModel.getDisk().getId(), diskModel.getStorageDomain().getSelectedItem().getId());
parameters.add(params);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveDisk, parameters, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
cancel();
}
use of org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel 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.DiskModel in project ovirt-engine by oVirt.
the class StoragesTree method getEntityId.
protected Object getEntityId(Object entity) {
DiskModel diskModel = (DiskModel) entity;
StorageDomain storageDomain = diskModel.getStorageDomain().getSelectedItem();
return ((DiskImage) diskModel.getDisk()).getImageId().toString() + storageDomain.getId().toString();
}
Aggregations