1
|
package eu.etaxonomy.taxeditor.ui.section.userecords;
|
2
|
|
3
|
import org.apache.log4j.Logger;
|
4
|
import org.eclipse.ui.forms.widgets.Section;
|
5
|
|
6
|
import eu.etaxonomy.cdm.model.description.CategoricalData;
|
7
|
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
|
8
|
import eu.etaxonomy.cdm.model.description.State;
|
9
|
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
|
10
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
|
11
|
import eu.etaxonomy.taxeditor.ui.forms.CheckboxElement;
|
12
|
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
|
13
|
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.EntityDetailType;
|
14
|
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
|
15
|
import eu.etaxonomy.taxeditor.ui.section.description.DescriptionElementDetailElement;
|
16
|
import eu.etaxonomy.taxeditor.ui.section.description.StateDataSection;
|
17
|
import eu.etaxonomy.taxeditor.ui.section.description.detail.AbstractDetailedDescriptionDetailElement;
|
18
|
|
19
|
//public class UseRecordDetailElement extends AbstractDetailedDescriptionDetailElement<CategoricalData> {
|
20
|
public class UseRecordDetailElement extends AbstractCdmDetailElement<CategoricalData> {
|
21
|
|
22
|
|
23
|
private static final Logger logger = Logger
|
24
|
.getLogger(DescriptionElementDetailElement.class);
|
25
|
|
26
|
private CheckboxElement checkbox_orderRelevant;
|
27
|
private TermComboElement UseCategory_stateData;
|
28
|
private UseSubCategorySection UseSubCategory_stateData;
|
29
|
//private AbstractDetailedDescriptionDetailElement detailElement;
|
30
|
|
31
|
/*public UseRecordDetailElement(CdmFormFactory formFactory,
|
32
|
ICdmFormElement formElement, CategoricalData entity, int style) {
|
33
|
super(formFactory, formElement, entity, style);
|
34
|
}*/
|
35
|
/*public UseRecordDetailElement(CdmFormFactory formFactory,
|
36
|
ICdmFormElement formElement, int style) {*/
|
37
|
public UseRecordDetailElement(CdmFormFactory formFactory,
|
38
|
ICdmFormElement formElement) {
|
39
|
super(formFactory, formElement);
|
40
|
}
|
41
|
|
42
|
/** {@inheritDoc} */
|
43
|
@Override
|
44
|
protected void createControls(ICdmFormElement formElement,
|
45
|
CategoricalData entity, int style) {
|
46
|
|
47
|
|
48
|
State state = State.NewInstance("Tato", "Toto", "Titi");
|
49
|
//checkbox_orderRelevant = formFactory.createCheckbox(formElement, "Order Relevant", entity.getOrderRelevant(), style);
|
50
|
UseCategory_stateData = formFactory.createTermComboElement(State.class, this, "Use Category", state , style);
|
51
|
//createEntityDetailSection(EntityDetailType.USE_CAT, getConversationHolder(), formElement, Section.EXPANDED);
|
52
|
UseSubCategory_stateData = (UseSubCategorySection) formFactory.createEntityDetailSection(EntityDetailType.USE_SUBCAT, getConversationHolder(), formElement,Section.EXPANDED);
|
53
|
//UseCategory_stateData.setEntity(entity);
|
54
|
UseSubCategory_stateData.setEntity(entity);
|
55
|
//UseCategory_stateData.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1));
|
56
|
UseSubCategory_stateData.setLayoutData(CdmFormFactory.FILL_HORIZONTALLY(2, 1));
|
57
|
|
58
|
}
|
59
|
|
60
|
|
61
|
/** {@inheritDoc} */
|
62
|
@Override
|
63
|
public void handleEvent(Object eventSource) {
|
64
|
if(eventSource == checkbox_orderRelevant){
|
65
|
getEntity().setOrderRelevant(checkbox_orderRelevant.getSelection());
|
66
|
}
|
67
|
}
|
68
|
|
69
|
}
|