Project

General

Profile

Download (1.59 KB) Statistics
| Branch: | Tag: | Revision:
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.group;
11

    
12
import eu.etaxonomy.cdm.model.common.Group;
13
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
14
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
15
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
16
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
17

    
18
/**
19
 * @author n.hoffmann
20
 * @created Mar 9, 2011
21
 * @version 1.0
22
 */
23
public class GroupDetailElement extends AbstractCdmDetailElement<Group> {
24

    
25
	private TextWithLabelElement text_name;
26
	
27
	/**
28
	 * @param formFactory
29
	 * @param formElement
30
	 */
31
	public GroupDetailElement(CdmFormFactory formFactory,
32
			ICdmFormElement formElement) {
33
		super(formFactory, formElement);
34
	}
35

    
36
	/* (non-Javadoc)
37
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
38
	 */
39
	@Override
40
	protected void createControls(ICdmFormElement formElement, Group entity,
41
			int style) {
42
		text_name = formFactory.createTextWithLabelElement(formElement, "Name", entity.getName(), style);
43
	}
44

    
45
	/* (non-Javadoc)
46
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
47
	 */
48
	@Override
49
	public void handleEvent(Object eventSource) {
50
		if(eventSource == text_name){
51
			getEntity().setName(text_name.getText());
52
		}
53
	}
54

    
55
}
(1-1/6)