Project

General

Profile

« Previous | Next » 

Revision 26d19e4f

Added by Cherian Mathew over 8 years ago

#5129 Extend export ui for remoting

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddExportWizard.java
1 1
// $Id$
2 2
/**
3 3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
4
* European Distributed Institute of Taxonomy
5 5
* http://www.e-taxonomy.eu
6
* 
6
*
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
......
12 12

  
13 13
import java.io.File;
14 14

  
15
import org.eclipse.core.runtime.jobs.Job;
15 16
import org.eclipse.jface.viewers.IStructuredSelection;
16 17
import org.eclipse.ui.IWorkbench;
18
import org.eclipse.ui.progress.IProgressConstants;
17 19

  
18 20
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
19 21
import eu.etaxonomy.taxeditor.store.CdmStore;
......
28 30
public class SddExportWizard extends AbstractExportWizard<SDDExportConfigurator> {
29 31

  
30 32
	private ExportToFileDestinationWizardPage page;
31
	
33

  
32 34
	private SDDExportConfigurator configurator;
33
	
35

  
34 36
	/* (non-Javadoc)
35 37
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
36 38
	 */
......
46 48
	/** {@inheritDoc} */
47 49
	@Override
48 50
	public boolean performFinish() {
49
		File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
50
		
51
		configurator.setDestination(file);
52
		
53
		CdmStore.getExportManager().run(configurator);
54
		
55
		return true;
51
	    File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
52

  
53
	    if(CdmStore.getCurrentSessionManager().isRemoting()) {
54
	        // create job
55
	        Job job = CdmStore.getExportManager().createIOServiceJob(configurator, file);
56
	        // configure the job
57
	        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
58
	        job.setUser(true);
59
	        // schedule job
60
	        job.schedule();
61
	    } else {
62
	        configurator.setDestination(file);
63
	        CdmStore.getExportManager().run(configurator);
64
	    }
65
	    return true;
56 66
	}
57 67

  
58 68
	/*
......
63 73
	@Override
64 74
	public void addPages() {
65 75
		super.addPages();
66
		
76

  
67 77
		page = ExportToFileDestinationWizardPage.Sdd();
68 78
		addPage(page);
69 79
	}
70
	
80

  
71 81
	/* (non-Javadoc)
72 82
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
73 83
	 */
74 84
	/** {@inheritDoc} */
75
	public void init(IWorkbench workbench, IStructuredSelection selection) {		
85
	@Override
86
    public void init(IWorkbench workbench, IStructuredSelection selection) {
76 87
		this.setWindowTitle("SDD Export");
77 88
		this.configurator = CdmStore.getExportManager().SddConfigurator();
78 89
	}

Also available in: Unified diff