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