merge-update from trunk
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / vocabulary / DefinedTermDetailSection.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.ui.section.vocabulary;
11
12 import org.eclipse.jface.viewers.ISelectionProvider;
13
14 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
16 import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
17 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
20
21 /**
22 * @author l.morris
23 * @date 4 Jan 2012
24 *
25 */
26 public class DefinedTermDetailSection<T extends DefinedTermBase> extends AbstractCdmDetailSection<T> {
27
28 /**
29 * @param formFactory
30 * @param definedTermClass
31 * @param conversation
32 * @param parentElement
33 * @param selectionProvider
34 * @param style
35 */
36 public DefinedTermDetailSection(CdmFormFactory formFactory,
37 Class<T> definedTermClass, ConversationHolder conversation, ICdmFormElement parentElement,
38 ISelectionProvider selectionProvider, int style) {
39 super(formFactory, definedTermClass, conversation, parentElement, selectionProvider, style);
40 }
41
42 /* (non-Javadoc)
43 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
44 */
45 @Override
46 public String getHeading() {
47 return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");
48 }
49
50 //FIXME clean up create element methods
51 /* (non-Javadoc)
52 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElementByType(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, java.lang.Class, int)
53 */
54 @Override
55 protected AbstractCdmDetailElement createCdmDetailElementByType(AbstractCdmDetailSection<T> parentElement, Class<T> entityClass, int style) {
56 return formFactory.createDefinedTermDetailElement(entityClass, parentElement, style);
57 }
58
59 /* (non-Javadoc)
60 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
61 */
62 @Override
63 protected AbstractCdmDetailElement<T> createCdmDetailElement(AbstractCdmDetailSection<T> parentElement, int style) {
64 return null;
65 }
66
67 }