Revision b0ce5b17
Added by Patrick Plitzner over 10 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/DefinedTermDetailSection.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2009 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
10 | 10 |
package eu.etaxonomy.taxeditor.ui.section.vocabulary; |
11 | 11 |
|
12 | 12 |
import org.eclipse.jface.viewers.ISelectionProvider; |
13 |
import org.eclipse.ui.forms.widgets.TableWrapLayout; |
|
14 | 13 |
|
15 | 14 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
16 | 15 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
17 | 16 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
18 | 17 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
19 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.DetailType;
|
|
18 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
|
20 | 19 |
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection; |
21 | 20 |
|
22 | 21 |
/** |
... | ... | |
28 | 27 |
|
29 | 28 |
/** |
30 | 29 |
* @param formFactory |
31 |
* @param definedTermClass
|
|
30 |
* @param definedTermClass |
|
32 | 31 |
* @param conversation |
33 | 32 |
* @param parentElement |
34 | 33 |
* @param selectionProvider |
... | ... | |
41 | 40 |
} |
42 | 41 |
|
43 | 42 |
/* (non-Javadoc) |
44 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getDetailType()
|
|
43 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
|
|
45 | 44 |
*/ |
46 | 45 |
@Override |
47 |
protected DetailType getDetailType() {
|
|
48 |
return null;
|
|
46 |
public String getHeading() {
|
|
47 |
return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");
|
|
49 | 48 |
} |
50 |
|
|
51 |
@Override |
|
52 |
protected void createControlsByType( |
|
53 |
AbstractCdmDetailSection<T> abstractCdmDetailSection, |
|
54 |
Class<T> clazz, int style) { |
|
55 |
TableWrapLayout layout = (TableWrapLayout) getLayoutComposite() |
|
56 |
.getLayout(); |
|
57 |
layout.topMargin = 10; |
|
58 |
layout.numColumns = 2; |
|
59 | 49 |
|
60 |
getLayoutComposite().setLayout(layout); |
|
61 |
detailElement = formFactory.createDefinedTermDetailElement(clazz, |
|
62 |
abstractCdmDetailSection, style); |
|
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); |
|
63 | 57 |
} |
64 | 58 |
|
65 | 59 |
/* (non-Javadoc) |
66 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
|
|
60 |
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
|
|
67 | 61 |
*/ |
68 | 62 |
@Override |
69 |
public String getHeading() {
|
|
70 |
return "Defined Term: "+ (getEntity() != null ? getEntity().getLabel() : "");
|
|
63 |
protected AbstractCdmDetailElement<T> createCdmDetailElement(AbstractCdmDetailSection<T> parentElement, int style) {
|
|
64 |
return null;
|
|
71 | 65 |
} |
72 | 66 |
|
73 | 67 |
} |
Also available in: Unified diff
merged trunk into branch