Source:
private void showNewDialog() { final AbstractDiskModel model = new NewDiskModel() { @Override public void onSave() { if (validate()) { flush(); getDiskModel().setEntity(this); parentModel.getParentListModel().setWindow(null); parentModel.getParentListModel().setWindow(parentModel.getUnitVmModel()); attachCommand.setIsAvailable(false); fillData(); Disk disk = super.getDisk(); if (disk.getDiskStorageType() == DiskStorageType.IMAGE || disk.getDiskStorageType() == DiskStorageType.CINDER) { ((DiskImage) disk).setActive(true); } } } @Override public void updateInterface(Version clusterVersion) { InstanceImageLineModel.this.updateInterface(clusterVersion, this); } @Override protected void updateBootableDiskAvailable() { updateBootableFrom(parentModel.getAllCurrentDisks()); } }; VM vm = new VM(); vm.setVdsGroupId(parentModel.getUnitVmModel().getSelectedCluster().getId()); vm.setStoragePoolId(parentModel.getUnitVmModel().getSelectedDataCenter().getId()); vm.setVdsGroupCompatibilityVersion(parentModel.getUnitVmModel().getSelectedCluster().getCompatibilityVersion()); vm.setQuotaId(parentModel.getUnitVmModel().getQuota().getSelectedItem().getId() ); model.setVm(vm); model.getSizeExtend().setIsAvailable(false); setupModelAsDialog(model, ConstantsManager.getInstance().getConstants().newVirtualDiskTitle(), HelpTag.new_virtual_disk, "new_virtual_disk"); showDialog(model); model.initialize(parentModel.getAllCurrentDisks()); if (getVm() != null) { model.setVm(getVm()); ((NewDiskModel)model).updateSuggestedDiskAliasFromServer(); } else { String currentVmName = parentModel.getUnitVmModel().getName().getEntity(); if (!StringUtils.isEmpty(currentVmName)) { model.getAlias().setEntity(suggestAliasForNewVm(currentVmName)); } } }

Target:
private void showNewDialog() { final AbstractDiskModel model = new NewDiskModel() { @Override public void onSave() { if (validate()) { flush(); getDiskModel().setEntity(this); parentModel.getParentListModel().setWindow(null); parentModel.getParentListModel().setWindow(parentModel.getUnitVmModel()); attachCommand.setIsAvailable(false); fillData(); Disk disk = super.getDisk(); if (disk.getDiskStorageType() == DiskStorageType.IMAGE || disk.getDiskStorageType() == DiskStorageType.CINDER) { ((DiskImage) disk).setActive(true); } } } @Override public void updateInterface(Version clusterVersion) { InstanceImageLineModel.this.updateInterface(clusterVersion, this); } @Override protected void updateBootableDiskAvailable() { updateBootableFrom(parentModel.getAllCurrentDisks()); } }; VM vm = new VM(); vm.setVdsGroupId(parentModel.getUnitVmModel().getSelectedCluster().getId()); vm.setStoragePoolId(parentModel.getUnitVmModel().getSelectedDataCenter().getId()); vm.setVdsGroupCompatibilityVersion(parentModel.getUnitVmModel().getSelectedCluster().getCompatibilityVersion()); Quota selectedQuota = parentModel.getUnitVmModel().getQuota().getSelectedItem(); vm.setQuotaId(selectedQuota == null ? null : selectedQuota.getId()); model.setVm(vm); model.getSizeExtend().setIsAvailable(false); setupModelAsDialog(model, ConstantsManager.getInstance().getConstants().newVirtualDiskTitle(), HelpTag.new_virtual_disk, "new_virtual_disk"); showDialog(model); model.initialize(parentModel.getAllCurrentDisks()); if (getVm() != null) { model.setVm(getVm()); ((NewDiskModel)model).updateSuggestedDiskAliasFromServer(); } else { String currentVmName = parentModel.getUnitVmModel().getName().getEntity(); if (!StringUtils.isEmpty(currentVmName)) { model.getAlias().setEntity(suggestAliasForNewVm(currentVmName)); } } }