Project

General

Profile

Download (2.21 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
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
*/
10

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

    
13
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.events.SelectionListener;
15

    
16
import eu.etaxonomy.cdm.model.common.OriginalSourceBase;
17
import eu.etaxonomy.cdm.model.common.OriginalSourceType;
18
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
19
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
20
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
21
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
22
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
23

    
24
/**
25
 * @author n.hoffmann
26
 * @created Mar 16, 2010
27
 * @version 1.0
28
 */
29
public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase> extends AbstractReferencedEntityElement<T> {
30
	protected EnumComboElement<OriginalSourceType> combo_origsourcetype;
31
	protected TextWithLabelElement text_idInSource;
32
	protected TextWithLabelElement text_idNamespace;
33
    protected TextWithLabelElement text_originaleNameString;
34

    
35
	public AbstractOriginalSourceElement(CdmFormFactory formFactory,
36
			AbstractFormSection section,
37
			T element, SelectionListener removeListener,
38
			int style) {
39
		super(formFactory, section, element, removeListener, style);
40
	}
41

    
42
	/**
43
	 * {@inheritDoc}
44
	 */
45
	@Override
46
	public void setEntity(T entity) {
47
	    super.setEntity(entity);
48
        text_originaleNameString.setText(entity.getOriginalNameString());
49
	}
50

    
51
	/** {@inheritDoc} */
52
	@Override
53
	public void createControls(ICdmFormElement formElement, int style) {
54
		combo_origsourcetype = formFactory
55
				.createEnumComboElement(OriginalSourceType.class,
56
						formElement, style);
57
		super.createControls(formElement, style);
58
		text_idInSource = formFactory.createTextWithLabelElement(formElement, "Id In Source", null, style);
59
		text_idNamespace = formFactory.createTextWithLabelElement(formElement, "ID Namespace", null, style);
60
		text_originaleNameString = formFactory.createTextWithLabelElement(
61
		        formElement, "Original Name", null, SWT.NULL);
62
	}
63
}
(1-1/19)