Source:
<code>public boolean performFinish() { try { IProject project = verificationPage.getProject(); final VerificationType type = verificationPage.getVerificationType(); String name = verificationPage.getVerificationName(); IPath containerPath = verificationPage.getPathInProject(); IQ7Folder folder = RcpttCore.create(project).getFolder(containerPath); verification = folder.createVerification(name, type, true, new NullProgressMonitor()); if (takeSnapshot) { VerificationViewer viewer = VerificationUIManager.getInstance() .getViewer(type); IQ7NamedElement workingCopy = verification .getWorkingCopy(new NullProgressMonitor()); try { final IQ7Editor<Verification> editor = viewer.getViewer() .createEditor(); editor.setElement(workingCopy); VerificationSnapshotAction action = new VerificationSnapshotAction(getShell(), editor, selector); action.setJoin(true); action.run(); if (action.getStatus().getSeverity() == IStatus.CANCEL) { workingCopy.discardWorkingCopy(); workingCopy = null; new DeleteResourceChange(verification.getPath(), true, true). perform(new NullProgressMonitor()); return false; } final IWorkspaceRunnable operation = new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { editor.save(); } }; try { ResourcesPlugin.getWorkspace().run(operation, new NullProgressMonitor()); <START> Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); <END> WriteAccessChecker writeAccessChecker = new WriteAccessChecker(shell); if (!writeAccessChecker.makeResourceWritable(workingCopy)) { return false; } workingCopy.commitWorkingCopy(true, new NullProgressMonitor()); } catch (CoreException e) { Q7UIPlugin.log(e.getCause()); } finally { editor.dispose(); } } finally { if (workingCopy != null) workingCopy.discardWorkingCopy(); } } else { IDE.openEditor(getPage(), (IFile) verification.getResource()); } } catch (Exception e) { Q7UIPlugin.log(e); return false; } return true; }</code><technical_language>dialog's shell</technical_language>

Target:
public boolean performFinish() { try { IProject project = verificationPage.getProject(); final VerificationType type = verificationPage.getVerificationType(); String name = verificationPage.getVerificationName(); IPath containerPath = verificationPage.getPathInProject(); IQ7Folder folder = RcpttCore.create(project).getFolder(containerPath); verification = folder.createVerification(name, type, true, new NullProgressMonitor()); if (takeSnapshot) { VerificationViewer viewer = VerificationUIManager.getInstance() .getViewer(type); IQ7NamedElement workingCopy = verification .getWorkingCopy(new NullProgressMonitor()); try { final IQ7Editor<Verification> editor = viewer.getViewer() .createEditor(); editor.setElement(workingCopy); VerificationSnapshotAction action = new VerificationSnapshotAction(getShell(), editor, selector); action.setJoin(true); action.run(); if (action.getStatus().getSeverity() == IStatus.CANCEL) { workingCopy.discardWorkingCopy(); workingCopy = null; new DeleteResourceChange(verification.getPath(), true, true). perform(new NullProgressMonitor()); return false; } final IWorkspaceRunnable operation = new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { editor.save(); } }; try { ResourcesPlugin.getWorkspace().run(operation, new NullProgressMonitor()); WriteAccessChecker writeAccessChecker = new WriteAccessChecker(getShell()); if (!writeAccessChecker.makeResourceWritable(workingCopy)) { return false; } workingCopy.commitWorkingCopy(true, new NullProgressMonitor()); } catch (CoreException e) { Q7UIPlugin.log(e.getCause()); } finally { editor.dispose(); } } finally { if (workingCopy != null) workingCopy.discardWorkingCopy(); } } else { IDE.openEditor(getPage(), (IFile) verification.getResource()); } } catch (Exception e) { Q7UIPlugin.log(e); return false; } return true; }