3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.vocabulary
;
12 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
13 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
.DetailType
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
27 public class DefinedTermDetailSection
<T
extends DefinedTermBase
> extends AbstractCdmDetailSection
<T
> {
30 private Class definedTermClass
;
34 * @param definedTermClass
36 * @param parentElement
37 * @param selectionProvider
40 public DefinedTermDetailSection(CdmFormFactory formFactory
,
41 Class definedTermClass
, ConversationHolder conversation
, ICdmFormElement parentElement
,
42 ISelectionProvider selectionProvider
, int style
) {
43 super(formFactory
, definedTermClass
, conversation
, parentElement
, selectionProvider
, style
);
47 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
50 protected DetailType
getDetailType() {
55 protected void createControlsByType(
56 AbstractCdmDetailSection
<T
> abstractCdmDetailSection
,
57 Class
<T
> clazz
, int style
) {
58 TableWrapLayout layout
= (TableWrapLayout
) getLayoutComposite()
60 layout
.topMargin
= 10;
61 layout
.numColumns
= 2;
63 getLayoutComposite().setLayout(layout
);
64 detailElement
= formFactory
.createDefinedTermDetailElement(clazz
,
65 abstractCdmDetailSection
, style
);
69 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
72 public String
getHeading() {
73 return "Defined Term: "+ (getEntity() != null ?
getEntity().getLabel() : "");