/**
   * Adds a duplicate of the selected VM to the block
   *
   * @since 3.2
   */
  protected void copyVM() {
    IStructuredSelection selection = (IStructuredSelection) fVMList.getSelection();
    Iterator<IVMInstall> it = selection.iterator();

    ArrayList<VMStandin> newEntries = new ArrayList<VMStandin>();
    while (it.hasNext()) {
      IVMInstall selectedVM = it.next();
      // duplicate & add VM
      VMStandin standin = new VMStandin(selectedVM, createUniqueId(selectedVM.getVMInstallType()));
      standin.setName(generateName(selectedVM.getName()));
      EditVMInstallWizard wizard =
          new EditVMInstallWizard(standin, fVMs.toArray(new IVMInstall[fVMs.size()]));
      WizardDialog dialog = new WizardDialog(getShell(), wizard);
      int dialogResult = dialog.open();
      if (dialogResult == Window.OK) {
        VMStandin result = wizard.getResult();
        if (result != null) {
          newEntries.add(result);
        }
      } else if (dialogResult == Window.CANCEL) {
        // Canceling one wizard should cancel all subsequent wizards
        break;
      }
    }
    if (newEntries.size() > 0) {
      fVMs.addAll(newEntries);
      fVMList.refresh();
      fVMList.setSelection(new StructuredSelection(newEntries.toArray()));
    } else {
      fVMList.setSelection(selection);
    }
    fVMList.refresh(true);
  }