Source:
<code>protected void executeImport() { importModel.importVms( new IFrontendMultipleActionAsyncCallback() { @Override public void executed( FrontendMultipleActionAsyncResult result) { <START> VmBackupModel vmBackupModel = VmBackupModel.this; <END> vmBackupModel.getWindow().stopProgress(); vmBackupModel.cancel(); ArrayList<VdcReturnValueBase> retVals = (ArrayList<VdcReturnValueBase>) result .getReturnValue(); if (retVals != null && vmBackupModel.getSelectedItems().size() == retVals .size()) { StringBuilder importedVms = new StringBuilder(); int counter = 0; boolean toShowConfirmWindow = false; for (Object item : vmBackupModel.getSelectedItems()) { VM vm = (VM) item; if (retVals.get(counter) != null && retVals.get(counter).getCanDoAction()) { importedVms.append(vm.getName()).append(", "); toShowConfirmWindow = true; } counter++; } if (toShowConfirmWindow) { ConfirmationModel confirmModel = new ConfirmationModel(); vmBackupModel.setConfirmWindow(confirmModel); confirmModel.setTitle(ConstantsManager.getInstance() .getConstants() .importVirtualMachinesTitle()); confirmModel.setHelpTag(HelpTag.import_virtual_machine); confirmModel.setHashName("import_virtual_machine"); confirmModel.setMessage(ConstantsManager.getInstance() .getMessages() .importProcessHasBegunForVms(StringHelper.trimEnd(importedVms.toString().trim(), ','))); UICommand tempVar2 = new UICommand("CancelConfirm", vmBackupModel); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().close()); tempVar2.setIsDefault(true); tempVar2.setIsCancel(true); confirmModel.getCommands().add(tempVar2); } } } }, cloneObjectMap); }</code><technical_language>drop explicit extraction of vmBackupModel methods getWindow(), cancel(), getSelectedItems() this is anonymous class</technical_language>

Target:
protected void executeImport() { importModel.importVms( new IFrontendMultipleActionAsyncCallback() { @Override public void executed( FrontendMultipleActionAsyncResult result) { getWindow().stopProgress(); cancel(); ArrayList<VdcReturnValueBase> retVals = (ArrayList<VdcReturnValueBase>) result .getReturnValue(); if (retVals != null && getSelectedItems().size() == retVals .size()) { StringBuilder importedVms = new StringBuilder(); int counter = 0; boolean toShowConfirmWindow = false; for (Object item : getSelectedItems()) { VM vm = (VM) item; if (retVals.get(counter) != null && retVals.get(counter).getCanDoAction()) { importedVms.append(vm.getName()).append(", "); toShowConfirmWindow = true; } counter++; } if (toShowConfirmWindow) { ConfirmationModel confirmModel = new ConfirmationModel(); setConfirmWindow(confirmModel); confirmModel.setTitle(ConstantsManager.getInstance() .getConstants() .importVirtualMachinesTitle()); confirmModel.setHelpTag(HelpTag.import_virtual_machine); confirmModel.setHashName("import_virtual_machine"); confirmModel.setMessage(ConstantsManager.getInstance() .getMessages() .importProcessHasBegunForVms(StringHelper.trimEnd(importedVms.toString().trim(), ','))); UICommand tempVar2 = new UICommand("CancelConfirm", VmBackupModel.this); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().close()); tempVar2.setIsDefault(true); tempVar2.setIsCancel(true); confirmModel.getCommands().add(tempVar2); } } } }, cloneObjectMap); }