Project

General

Profile

Download (1.68 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

    
11
package eu.etaxonomy.taxeditor.io;
12

    
13
import org.eclipse.core.runtime.jobs.Job;
14
import org.eclipse.ui.progress.IProgressConstants;
15

    
16
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
17
import eu.etaxonomy.cdm.io.common.IIoConfigurator;
18

    
19
/**
20
 * <p>Abstract AbstractIOHandler class.</p>
21
 *
22
 * @author n.hoffmann
23
 * @created Sep 11, 2009
24
 * @version 1.0
25
 */
26
public abstract class AbstractIOHandler<CONFIGURATOR extends IIoConfigurator> {
27

    
28
	protected CdmApplicationController applicationController;
29
	
30
	public static enum TYPE {
31
		BerlinModel, Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd
32
	}
33

    
34
	/**
35
	 * <p>Constructor for AbstractIOHandler.</p>
36
	 *
37
	 * @param applicationController a {@link eu.etaxonomy.cdm.api.application.CdmApplicationController} object.
38
	 * @param <CONFIGURATOR> a CONFIGURATOR object.
39
	 */
40
	protected AbstractIOHandler(CdmApplicationController applicationController){
41
		this.applicationController = applicationController;
42
	}
43
	
44
	/**
45
	 * Starts the IO process
46
	 *
47
	 * @param configurator a CONFIGURATOR object.
48
	 */
49
	public void run(final CONFIGURATOR configurator){
50
		
51
		Job job = createIOJob(configurator);
52
		job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
53
		job.setUser(true);
54
		job.schedule();
55
		
56
	}
57
	
58
	/**
59
	 * <p>createIOJob</p>
60
	 *
61
	 * @param configurator a CONFIGURATOR object.
62
	 * @return a {@link org.eclipse.core.runtime.jobs.Job} object.
63
	 */
64
	protected abstract Job createIOJob(CONFIGURATOR configurator);
65
}
(1-1/3)