4040import org .eclipse .ui .IPageLayout ;
4141import org .eclipse .ui .IViewPart ;
4242import org .eclipse .ui .IWorkbenchPage ;
43+ import org .eclipse .ui .PlatformUI ;
4344import org .eclipse .ui .internal .WorkbenchPlugin ;
4445import org .eclipse .ui .internal .dialogs .ImportExportWizard ;
4546import org .eclipse .ui .internal .wizards .datatransfer .WizardProjectsImportPage ;
4647import org .eclipse .ui .internal .wizards .datatransfer .WizardProjectsImportPage .ProjectRecord ;
4748import org .eclipse .ui .navigator .resources .ProjectExplorer ;
4849import org .eclipse .ui .tests .TestPlugin ;
49- import org .eclipse .ui .tests .harness .util .DialogCheck ;
5050import org .eclipse .ui .tests .harness .util .EmptyPerspective ;
5151import org .eclipse .ui .tests .harness .util .FileUtil ;
5252import org .eclipse .ui .tests .harness .util .UITestCase ;
@@ -66,6 +66,10 @@ public ImportExistingArchiveProjectFilterTest() {
6666
6767 @ Override
6868 protected void doTearDown () throws Exception {
69+ if (dialog != null ) {
70+ dialog .close ();
71+ dialog = null ;
72+ }
6973 IWorkspaceRoot wsRoot = ResourcesPlugin .getWorkspace ().getRoot ();
7074 IProject [] projects = wsRoot .getProjects ();
7175 for (int i = projects .length - 1 ; i >= 0 ; i --) {
@@ -158,6 +162,7 @@ private void processElementAndChildren(Object element, ITreeContentProvider cont
158162 }
159163 }
160164
165+ private WizardDialog dialog ;
161166 public WizardProjectsImportPage getNewWizard () {
162167 ImportExportWizard wizard = new ImportExportWizard (ImportExportWizard .IMPORT );
163168 wizard .init (getWorkbench (), null );
@@ -173,7 +178,10 @@ public WizardProjectsImportPage getNewWizard() {
173178
174179 Shell shell = getShell ();
175180
176- WizardDialog dialog = new WizardDialog (shell , wizard );
181+ if (dialog != null ) {
182+ dialog .close ();
183+ }
184+ dialog = new WizardDialog (shell , wizard );
177185 dialog .create ();
178186 dialog .getShell ().setSize (Math .max (100 , dialog .getShell ().getSize ().x ), 100 );
179187
@@ -185,6 +193,6 @@ public WizardProjectsImportPage getNewWizard() {
185193 }
186194
187195 private Shell getShell () {
188- return DialogCheck .getShell ();
196+ return PlatformUI . getWorkbench (). getActiveWorkbenchWindow () .getShell ();
189197 }
190198}
0 commit comments