Revision 2b3380bd
Added by Patrick Plitzner about 10 years ago
- BioCase querying as a separate thread
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.taxeditor.dataimport.wizard; |
11 | 11 |
|
12 | 12 |
import org.apache.log4j.Logger; |
13 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
14 |
import org.eclipse.core.runtime.IStatus; |
|
15 |
import org.eclipse.core.runtime.Status; |
|
16 |
import org.eclipse.core.runtime.jobs.Job; |
|
13 | 17 |
import org.eclipse.jface.viewers.IStructuredSelection; |
14 | 18 |
import org.eclipse.jface.wizard.Wizard; |
15 | 19 |
import org.eclipse.ui.IImportWizard; |
... | ... | |
53 | 57 |
*/ |
54 | 58 |
@Override |
55 | 59 |
public boolean performFinish() { |
56 |
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); |
|
60 |
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
|
|
57 | 61 |
|
58 |
try { |
|
59 | 62 |
query = searchPage.getQuery(); |
60 |
DerivedUnitEditorInput input = new DerivedUnitEditorInput(query); |
|
61 |
input.query(); |
|
62 |
page.openEditor(input, DataImportEditor.ID, true); |
|
63 |
} catch ( PartInitException e ) { |
|
64 |
//Put your exception handler here if you wish to |
|
65 |
} |
|
63 |
final DerivedUnitEditorInput input = new DerivedUnitEditorInput(query); |
|
64 |
Job queryJob = new Job("Query Biocase") { |
|
65 |
|
|
66 |
@Override |
|
67 |
protected IStatus run(IProgressMonitor monitor) { |
|
68 |
input.query(); |
|
69 |
return Status.OK_STATUS; |
|
70 |
} |
|
71 |
}; |
|
72 |
queryJob.schedule(); |
|
73 |
try { |
|
74 |
page.openEditor(input, DataImportEditor.ID, true); |
|
75 |
} catch ( PartInitException e ) { |
|
76 |
//Put your exception handler here if you wish to |
|
77 |
} |
|
66 | 78 |
return true; |
67 | 79 |
} |
68 | 80 |
|
Also available in: Unified diff