3 * Copyright (C) 2013 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
.occurrence
;
12 import org
.eclipse
.swt
.events
.SelectionListener
;
13 import org
.eclipse
.swt
.widgets
.Composite
;
14 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
17 import eu
.etaxonomy
.cdm
.model
.common
.EventBase
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.TimePeriodElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElementComposite
;
23 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
30 public abstract class AbstractEventDetailElementComposite
<T
extends EventBase
> extends AbstractEntityCollectionElementComposite
<T
> {
32 protected EntitySelectionElement
<AgentBase
> selection_agent
;
33 protected TextWithLabelElement text_description
;
34 protected TimePeriodElement element_timePeriod
;
38 * Constructor for AbstractEventDetailElement.
42 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
46 * {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
50 * @param removeListener
51 * a {@link org.eclipse.swt.events.SelectionListener} object.
57 public AbstractEventDetailElementComposite(Composite parent
, FormToolkit formFactory
, AbstractFormSection section
, T entity
, SelectionListener removeListener
, int style
) {
58 super(parent
, formFactory
, section
, entity
, removeListener
, null, style
);
65 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
70 public void setEntity(T entity
) {
72 selection_agent
.setEntity(entity
.getActor());
73 text_description
.setText(entity
.getDescription());
74 element_timePeriod
.setEntity(entity
.getTimeperiod());
82 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
83 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
87 public void createControls(ICdmFormElement element
, int style
) {
88 selection_agent
= formFactory
.createSelectionElement(AgentBase
.class, getConversationHolder(), element
, "Actor", null, EntitySelectionElement
.ALL
, style
);
89 element_timePeriod
= formFactory
.createTimePeriodElement(element
, "Time Period", null, style
);
90 text_description
= formFactory
.createTextWithLabelElement(element
, "Description", null, style
);