Revision bc0e50fb
Added by Patrick Plitzner about 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java | ||
---|---|---|
236 | 236 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventDetailSection; |
237 | 237 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopeDetailSection; |
238 | 238 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.GeoScopePolyKeyDetailSection; |
239 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.NamedAreaDetailElement;
|
|
239 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.CollectingAreaDetailElement;
|
|
240 | 240 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.OriginalLabelDataSection; |
241 | 241 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.SourceCollectionDetailSection; |
242 | 242 |
import eu.etaxonomy.taxeditor.ui.section.occurrence.SpecimenCollectionDetailElement; |
... | ... | |
2700 | 2700 |
} |
2701 | 2701 |
|
2702 | 2702 |
} else if (entity instanceof NamedArea) { |
2703 |
element = new NamedAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
|
|
2703 |
element = new CollectingAreaDetailElement(this, parentElement, (NamedArea) entity, removeListener, style);
|
|
2704 | 2704 |
} else if (entity instanceof DeterminationEvent) { |
2705 | 2705 |
element = new DeterminationEventDetailElement(this, parentElement, (DeterminationEvent) entity, removeListener, style); |
2706 | 2706 |
} else if (entity instanceof User) { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectingAreaDetailElement.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
|
|
10 |
package eu.etaxonomy.taxeditor.ui.section.occurrence; |
|
11 |
|
|
12 |
import org.eclipse.swt.events.SelectionListener; |
|
13 |
|
|
14 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
15 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
|
16 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
17 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
18 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
|
19 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
20 |
|
|
21 |
/** |
|
22 |
* <p> |
|
23 |
* CollectingAreasDetailElement class. |
|
24 |
* </p> |
|
25 |
* |
|
26 |
* @author n.hoffmann |
|
27 |
* @created Oct 14, 2010 |
|
28 |
* @version 1.0 |
|
29 |
*/ |
|
30 |
public class CollectingAreaDetailElement extends |
|
31 |
AbstractEntityCollectionElement<NamedArea> { |
|
32 |
|
|
33 |
private EntitySelectionElement<NamedArea> selection_namedArea; |
|
34 |
|
|
35 |
/** |
|
36 |
* <p> |
|
37 |
* Constructor for CollectingAreasDetailElement. |
|
38 |
* </p> |
|
39 |
* |
|
40 |
* @param formFactory |
|
41 |
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} |
|
42 |
* object. |
|
43 |
* @param section |
|
44 |
* a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} |
|
45 |
* object. |
|
46 |
* @param entity |
|
47 |
* a {@link eu.etaxonomy.cdm.model.location.NamedArea} object. |
|
48 |
* @param removeListener |
|
49 |
* a {@link org.eclipse.swt.events.SelectionListener} object. |
|
50 |
* @param style |
|
51 |
* a int. |
|
52 |
*/ |
|
53 |
public CollectingAreaDetailElement(CdmFormFactory formFactory, |
|
54 |
AbstractFormSection section, NamedArea entity, |
|
55 |
SelectionListener removeListener, int style) { |
|
56 |
super(formFactory, section, entity, removeListener, null, style); |
|
57 |
} |
|
58 |
|
|
59 |
/* |
|
60 |
* (non-Javadoc) |
|
61 |
* |
|
62 |
* @see |
|
63 |
* eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity |
|
64 |
* (java.lang.Object) |
|
65 |
*/ |
|
66 |
/** {@inheritDoc} */ |
|
67 |
@Override |
|
68 |
public void setEntity(NamedArea entity) { |
|
69 |
selection_namedArea.setEntity(entity); |
|
70 |
} |
|
71 |
|
|
72 |
/* |
|
73 |
* (non-Javadoc) |
|
74 |
* |
|
75 |
* @see |
|
76 |
* eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls |
|
77 |
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int) |
|
78 |
*/ |
|
79 |
/** {@inheritDoc} */ |
|
80 |
@Override |
|
81 |
public void createControls(ICdmFormElement formElement, int style) { |
|
82 |
selection_namedArea = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(), |
|
83 |
formElement, "Area", |
|
84 |
null, EntitySelectionElement.NOTHING, style); |
|
85 |
} |
|
86 |
|
|
87 |
/* |
|
88 |
* (non-Javadoc) |
|
89 |
* |
|
90 |
* @see |
|
91 |
* eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent |
|
92 |
* (java.lang.Object) |
|
93 |
*/ |
|
94 |
/** {@inheritDoc} */ |
|
95 |
@Override |
|
96 |
public void handleEvent(Object eventSource) { |
|
97 |
if (eventSource == selection_namedArea) { |
|
98 |
setEntity(selection_namedArea.getSelection()); |
|
99 |
} |
|
100 |
} |
|
101 |
|
|
102 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/NamedAreaDetailElement.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
|
|
10 |
package eu.etaxonomy.taxeditor.ui.section.occurrence; |
|
11 |
|
|
12 |
import org.eclipse.swt.events.SelectionListener; |
|
13 |
|
|
14 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
15 |
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection; |
|
16 |
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory; |
|
17 |
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement; |
|
18 |
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement; |
|
19 |
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement; |
|
20 |
|
|
21 |
/** |
|
22 |
* <p> |
|
23 |
* CollectingAreasDetailElement class. |
|
24 |
* </p> |
|
25 |
* |
|
26 |
* @author n.hoffmann |
|
27 |
* @created Oct 14, 2010 |
|
28 |
* @version 1.0 |
|
29 |
*/ |
|
30 |
public class NamedAreaDetailElement extends |
|
31 |
AbstractEntityCollectionElement<NamedArea> { |
|
32 |
|
|
33 |
private EntitySelectionElement<NamedArea> selection_namedArea; |
|
34 |
|
|
35 |
/** |
|
36 |
* <p> |
|
37 |
* Constructor for CollectingAreasDetailElement. |
|
38 |
* </p> |
|
39 |
* |
|
40 |
* @param formFactory |
|
41 |
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} |
|
42 |
* object. |
|
43 |
* @param section |
|
44 |
* a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection} |
|
45 |
* object. |
|
46 |
* @param entity |
|
47 |
* a {@link eu.etaxonomy.cdm.model.location.NamedArea} object. |
|
48 |
* @param removeListener |
|
49 |
* a {@link org.eclipse.swt.events.SelectionListener} object. |
|
50 |
* @param style |
|
51 |
* a int. |
|
52 |
*/ |
|
53 |
public NamedAreaDetailElement(CdmFormFactory formFactory, |
|
54 |
AbstractFormSection section, NamedArea entity, |
|
55 |
SelectionListener removeListener, int style) { |
|
56 |
super(formFactory, section, entity, removeListener, null, style); |
|
57 |
} |
|
58 |
|
|
59 |
/* |
|
60 |
* (non-Javadoc) |
|
61 |
* |
|
62 |
* @see |
|
63 |
* eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#setEntity |
|
64 |
* (java.lang.Object) |
|
65 |
*/ |
|
66 |
/** {@inheritDoc} */ |
|
67 |
@Override |
|
68 |
public void setEntity(NamedArea entity) { |
|
69 |
selection_namedArea.setEntity(entity); |
|
70 |
} |
|
71 |
|
|
72 |
/* |
|
73 |
* (non-Javadoc) |
|
74 |
* |
|
75 |
* @see |
|
76 |
* eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls |
|
77 |
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int) |
|
78 |
*/ |
|
79 |
/** {@inheritDoc} */ |
|
80 |
@Override |
|
81 |
public void createControls(ICdmFormElement formElement, int style) { |
|
82 |
selection_namedArea = formFactory.createSelectionElement(NamedArea.class, //getConversationHolder(), |
|
83 |
formElement, "Area", |
|
84 |
null, EntitySelectionElement.NOTHING, style); |
|
85 |
} |
|
86 |
|
|
87 |
/* |
|
88 |
* (non-Javadoc) |
|
89 |
* |
|
90 |
* @see |
|
91 |
* eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent |
|
92 |
* (java.lang.Object) |
|
93 |
*/ |
|
94 |
/** {@inheritDoc} */ |
|
95 |
@Override |
|
96 |
public void handleEvent(Object eventSource) { |
|
97 |
if (eventSource == selection_namedArea) { |
|
98 |
setEntity(selection_namedArea.getSelection()); |
|
99 |
} |
|
100 |
} |
|
101 |
|
|
102 |
} |
Also available in: Unified diff
Rename class to avoid duplicate class names