1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 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
|
package eu.etaxonomy.taxeditor.editor.definedterm.input;
|
11
|
|
12
|
import org.eclipse.ui.IEditorInput;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
15
|
import eu.etaxonomy.cdm.model.common.ExtensionType;
|
16
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
17
|
import eu.etaxonomy.cdm.model.description.Feature;
|
18
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
19
|
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
|
20
|
|
21
|
/**
|
22
|
* @author l.morris
|
23
|
* @date 3 Jan 2012
|
24
|
*
|
25
|
*/
|
26
|
public class DefinedTermEditorInputFactory {
|
27
|
|
28
|
// public static final String NamedArea = "eu.etaxonomy.taxeditor.editor.namedArea";
|
29
|
|
30
|
/**
|
31
|
* @param clazz
|
32
|
* @return
|
33
|
*/
|
34
|
public static IEditorInput NewInstance(Class<? extends DefinedTermBase> clazz) {
|
35
|
if(clazz == NamedArea.class){
|
36
|
return new NamedAreaEditorInput();
|
37
|
}
|
38
|
if (clazz == NamedAreaLevel.class){
|
39
|
return new NamedAreaLevelEditorInput();
|
40
|
}
|
41
|
if (clazz == ExtensionType.class){
|
42
|
return new ExtensionTypeEditorInput();
|
43
|
}
|
44
|
if (clazz == MarkerType.class){
|
45
|
return new MarkerTypeEditorInput();
|
46
|
}
|
47
|
if (clazz == Feature.class){
|
48
|
return new FeatureEditorInput();
|
49
|
}
|
50
|
|
51
|
return null;
|
52
|
}
|
53
|
|
54
|
}
|