Search in sources :

Example 1 with ChangeCDModel

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);
}
Also used : VM(org.ovirt.engine.core.common.businessentities.VM) ChangeCDModel(org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel)

Example 2 with ChangeCDModel

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);
}
Also used : VM(org.ovirt.engine.core.common.businessentities.VM) ChangeDiskCommandParameters(org.ovirt.engine.core.common.action.ChangeDiskCommandParameters) ChangeCDModel(org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel)

Aggregations

VM (org.ovirt.engine.core.common.businessentities.VM)2 ChangeCDModel (org.ovirt.engine.ui.uicommonweb.models.configure.ChangeCDModel)2 ChangeDiskCommandParameters (org.ovirt.engine.core.common.action.ChangeDiskCommandParameters)1