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.DefinedTerm;
|
15
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
16
|
import eu.etaxonomy.cdm.model.common.ExtensionType;
|
17
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
18
|
import eu.etaxonomy.cdm.model.description.Feature;
|
19
|
|
20
|
import eu.etaxonomy.cdm.model.description.State;
|
21
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
22
|
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
|
23
|
|
24
|
/**
|
25
|
* @author l.morris
|
26
|
* @date 3 Jan 2012
|
27
|
*
|
28
|
*/
|
29
|
public class DefinedTermEditorInputFactory {
|
30
|
|
31
|
// public static final String NamedArea = "eu.etaxonomy.taxeditor.editor.namedArea";
|
32
|
|
33
|
/**
|
34
|
* @param clazz
|
35
|
* @return
|
36
|
*/
|
37
|
public static IEditorInput NewInstance(Class<? extends DefinedTermBase> clazz) {
|
38
|
if(clazz == NamedArea.class){
|
39
|
return new NamedAreaEditorInput();
|
40
|
}
|
41
|
if (clazz == NamedAreaLevel.class){
|
42
|
return new NamedAreaLevelEditorInput();
|
43
|
}
|
44
|
if (clazz == ExtensionType.class){
|
45
|
return new ExtensionTypeEditorInput();
|
46
|
}
|
47
|
if (clazz == MarkerType.class){
|
48
|
return new MarkerTypeEditorInput();
|
49
|
}
|
50
|
if (clazz == Feature.class){
|
51
|
return new FeatureEditorInput();
|
52
|
}
|
53
|
if (clazz == State.class){
|
54
|
return new StateEditorInput();
|
55
|
}
|
56
|
if (clazz == DefinedTerm.class){
|
57
|
return new ModifierEditorInput();
|
58
|
}
|
59
|
|
60
|
return null;
|
61
|
}
|
62
|
|
63
|
}
|