Project

General

Profile

« Previous | Next » 

Revision f561b00c

Added by Niels Hoffmann about 13 years ago

Refactoring selection elements so they can be configured

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractEventDetailElement.java
1 1
// $Id$
2 2
/**
3
* Copyright (C) 2007 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
*/
3
 * Copyright (C) 2007 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 10

  
11 11
package eu.etaxonomy.taxeditor.ui.section.occurrence;
12 12

  
......
15 15
import eu.etaxonomy.cdm.model.common.EventBase;
16 16
import eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection;
17 17
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
18 19
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
19 20
import eu.etaxonomy.taxeditor.ui.forms.TextWithLabelElement;
20 21
import eu.etaxonomy.taxeditor.ui.forms.TimePeriodElement;
21
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory.SelectionType;
22 22
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
23 23
import eu.etaxonomy.taxeditor.ui.selection.AgentSelectionElement;
24 24

  
25 25
/**
26
 * <p>Abstract AbstractEventDetailElement class.</p>
27
 *
26
 * <p>
27
 * Abstract AbstractEventDetailElement class.
28
 * </p>
29
 * 
28 30
 * @author n.hoffmann
29 31
 * @created Oct 14, 2010
30 32
 * @version 1.0
31 33
 */
32
public abstract class AbstractEventDetailElement<T extends EventBase> extends AbstractEntityCollectionElement<T> {
34
public abstract class AbstractEventDetailElement<T extends EventBase> extends
35
		AbstractEntityCollectionElement<T> {
33 36

  
34 37
	protected AgentSelectionElement selection_agent;
35 38
	protected TextWithLabelElement text_description;
36 39
	protected TimePeriodElement element_timePeriod;
37
	
40

  
38 41
	/**
39
	 * <p>Constructor for AbstractEventDetailElement.</p>
40
	 *
41
	 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
42
	 * @param section a {@link eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection} object.
43
	 * @param entity a T object.
44
	 * @param removeListener a {@link org.eclipse.swt.events.SelectionListener} object.
45
	 * @param style a int.
46
	 * @param <T> a T object.
42
	 * <p>
43
	 * Constructor for AbstractEventDetailElement.
44
	 * </p>
45
	 * 
46
	 * @param formFactory
47
	 *            a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory}
48
	 *            object.
49
	 * @param section
50
	 *            a {@link eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection}
51
	 *            object.
52
	 * @param entity
53
	 *            a T object.
54
	 * @param removeListener
55
	 *            a {@link org.eclipse.swt.events.SelectionListener} object.
56
	 * @param style
57
	 *            a int.
58
	 * @param <T>
59
	 *            a T object.
47 60
	 */
48 61
	public AbstractEventDetailElement(CdmFormFactory formFactory,
49 62
			AbstractFormSection section, T entity,
......
51 64
		super(formFactory, section, entity, removeListener, null, style);
52 65
	}
53 66

  
54
	/* (non-Javadoc)
55
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
67
	/*
68
	 * (non-Javadoc)
69
	 * 
70
	 * @see
71
	 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity
72
	 * (java.lang.Object)
56 73
	 */
57 74
	/** {@inheritDoc} */
58 75
	@Override
......
62 79
		element_timePeriod.setEntity(entity.getTimeperiod());
63 80
	}
64 81

  
65
	/* (non-Javadoc)
66
	 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
82
	/*
83
	 * (non-Javadoc)
84
	 * 
85
	 * @see
86
	 * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
87
	 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
67 88
	 */
68 89
	/** {@inheritDoc} */
69 90
	@Override
70 91
	public void createControls(ICdmFormElement element, int style) {
71
		selection_agent = (AgentSelectionElement) formFactory.createSelectionElement(SelectionType.AGENT, getConversationHolder(), element, "Actor", null, style);
72
		text_description = formFactory.createTextWithLabelElement(element, "Description", null, style);
73
		element_timePeriod = formFactory.createTimePeriodElement(element, "Time Period", null, style);
92
		selection_agent = (AgentSelectionElement) formFactory
93
				.createSelectionElement(SelectionType.AGENT,
94
						getConversationHolder(), element, "Actor", null,
95
						AgentSelectionElement.DEFAULT, style);
96
		text_description = formFactory.createTextWithLabelElement(element,
97
				"Description", null, style);
98
		element_timePeriod = formFactory.createTimePeriodElement(element,
99
				"Time Period", null, style);
74 100
	}
75 101

  
76 102
}

Also available in: Unified diff