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
|
import org.eclipse.ui.forms.widgets.TableWrapLayout;
|
14
|
|
15
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
16
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
17
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
|
18
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.DetailType;
|
19
|
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
|
20
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
|
21
|
|
22
|
/**
|
23
|
* @author l.morris
|
24
|
* @date 4 Jan 2012
|
25
|
*
|
26
|
*/
|
27
|
public class DefinedTermDetailSection<T extends DefinedTermBase> extends AbstractCdmDetailSection<T> {
|
28
|
|
29
|
|
30
|
private Class definedTermClass;
|
31
|
|
32
|
/**
|
33
|
* @param formFactory
|
34
|
* @param definedTermClass
|
35
|
* @param conversation
|
36
|
* @param parentElement
|
37
|
* @param selectionProvider
|
38
|
* @param style
|
39
|
*/
|
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);
|
44
|
}
|
45
|
|
46
|
/* (non-Javadoc)
|
47
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
|
48
|
*/
|
49
|
@Override
|
50
|
protected DetailType getDetailType() {
|
51
|
return null;
|
52
|
}
|
53
|
|
54
|
@Override
|
55
|
protected void createControlsByType(
|
56
|
AbstractCdmDetailSection<T> abstractCdmDetailSection,
|
57
|
Class<T> clazz, int style) {
|
58
|
TableWrapLayout layout = (TableWrapLayout) getLayoutComposite()
|
59
|
.getLayout();
|
60
|
layout.topMargin = 10;
|
61
|
layout.numColumns = 2;
|
62
|
|
63
|
getLayoutComposite().setLayout(layout);
|
64
|
detailElement = formFactory.createDefinedTermDetailElement(clazz,
|
65
|
abstractCdmDetailSection, style);
|
66
|
}
|
67
|
|
68
|
/* (non-Javadoc)
|
69
|
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
|
70
|
*/
|
71
|
@Override
|
72
|
public String getHeading() {
|
73
|
return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");
|
74
|
}
|
75
|
|
76
|
}
|