Beispiel #1
0
  public void setVm(VM newVm) {
    DisplayType oldDisplayType = getVm().getDisplayType();
    DisplayType oldDefaultDisplayType = getVm().getDefaultDisplayType();
    int oldOs = getVm().getOs();

    this.vm = newVm;

    for (ConsoleModel cModel : consoleModels.values()) { // update my console models too
      cModel.setEntity(newVm);
    }

    // if display types changed, we'd like to update the default selected protocol as the old one
    // may be invalid
    if (newVm.getDisplayType() != oldDisplayType
        || newVm.getDefaultDisplayType() != oldDefaultDisplayType
        || newVm.getOs() != oldOs) {
      setDefaultSelectedProtocol();
    }
  }
Beispiel #2
0
  private void changeCD(Object sender, EventArgs args) {
    VM entity = (VM) getItem().getEntity();
    ChangeCDModel model = (ChangeCDModel) sender;

    // TODO: Patch!
    String imageName = model.getTitle();
    if (ObjectUtils.objectsEqual(
        imageName, ConstantsManager.getInstance().getConstants().noCds())) {
      return;
    }

    Frontend.getInstance()
        .runAction(
            VdcActionType.ChangeDisk,
            new ChangeDiskCommandParameters(
                entity.getId(),
                ObjectUtils.objectsEqual(imageName, ConsoleModel.getEjectLabel())
                    ? ""
                    : imageName)); //$NON-NLS-1$
  }