use of org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel in project ovirt-engine by oVirt.
the class VmListModel method retrieveIsoImages.
private void retrieveIsoImages() {
Object tempVar = getSelectedItem();
VM vm = (VM) ((tempVar instanceof VM) ? tempVar : null);
if (vm == null) {
return;
}
getIsoImages().clear();
ChangeCDModel tempVar2 = new ChangeCDModel();
tempVar2.setTitle(ConsoleModel.getEjectLabel());
ChangeCDModel ejectModel = tempVar2;
ejectModel.getExecutedEvent().addListener(this);
getIsoImages().add(ejectModel);
ChangeCDModel tempVar4 = new ChangeCDModel();
tempVar4.setTitle(ConstantsManager.getInstance().getConstants().noCds());
getIsoImages().add(tempVar4);
}
use of org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel in project ovirt-engine by oVirt.
the class VmListModel method changeCD.
private void changeCD(Object sender, EventArgs e) {
ChangeCDModel model = (ChangeCDModel) sender;
// TODO: Patch!
String isoName = model.getTitle();
if (Objects.equals(isoName, ConstantsManager.getInstance().getConstants().noCds())) {
return;
}
Object tempVar = getSelectedItem();
VM vm = (VM) ((tempVar instanceof VM) ? tempVar : null);
if (vm == null) {
return;
}
Frontend.getInstance().runMultipleAction(ActionType.ChangeDisk, new ArrayList<>(Arrays.asList(new ActionParametersBase[] { new ChangeDiskCommandParameters(vm.getId(), // $NON-NLS-1$
Objects.equals(isoName, ConsoleModel.getEjectLabel()) ? "" : isoName) })), result -> {
}, null);
}
Aggregations