Project

General

Profile

Download (2.29 KB) Statistics
| Branch: | Tag: | Revision:
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.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
19
import eu.etaxonomy.taxeditor.ui.element.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
	 * @param formFactory
31
	 * @param definedTermClass
32
	 * @param conversation
33
	 * @param parentElement
34
	 * @param selectionProvider
35
	 * @param style
36
	 */
37
	public DefinedTermDetailSection(CdmFormFactory formFactory,
38
			Class<T> definedTermClass, ConversationHolder conversation, ICdmFormElement parentElement,
39
			ISelectionProvider selectionProvider, int style) {
40
		super(formFactory, definedTermClass, conversation, parentElement, selectionProvider, style);
41
	}
42

    
43
	/* (non-Javadoc)
44
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
45
	 */
46
	@Override
47
	protected DetailType getDetailType() {
48
		return null;
49
	}
50

    
51
    @Override
52
    protected void createControlsByType(AbstractCdmDetailSection<T> abstractCdmDetailSection, Class<T> clazz, int style) {
53
        TableWrapLayout layout = (TableWrapLayout) getLayoutComposite().getLayout();
54
        layout.topMargin = 10;
55
        layout.numColumns = 2;
56

    
57
        getLayoutComposite().setLayout(layout);
58
        detailElement = formFactory.createDefinedTermDetailElement(clazz, abstractCdmDetailSection, style);
59
    }
60

    
61
	/* (non-Javadoc)
62
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
63
	 */
64
	@Override
65
	public String getHeading() {
66
		return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");
67
	}
68

    
69
}
(3-3/8)