Project

General

Profile

Download (1.57 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.grantedAuthority;
11

    
12
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
13
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
14
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
15
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
16
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
17
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
18

    
19
/**
20
 * @author n.hoffmann
21
 * @author a.kohlbecker
22
 * @created Mar 9, 2011
23
 * @version 1.0
24
 */
25
public class GrantedAuthorityDetailElement extends AbstractCdmDetailElement<GrantedAuthorityImpl> {
26

    
27
	private TextWithLabelElement text_authority;
28
	
29
	/**
30
	 * @param formFactory
31
	 * @param formElement
32
	 */
33
	public GrantedAuthorityDetailElement(CdmFormFactory formFactory,
34
			ICdmFormElement formElement) {
35
		super(formFactory, formElement);
36
	}
37

    
38
	@Override
39
	protected void createControls(ICdmFormElement formElement,
40
			GrantedAuthorityImpl entity, int style) {
41
		
42
		String labelText = GrantedAuthorityLabelTextProvider.getText(entity);
43
		text_authority = formFactory.createTextWithLabelElement(formElement, "Authority", labelText, style);
44
		
45
	}
46

    
47
	@Override
48
	public void handleEvent(Object eventSource) {
49
		if(eventSource == text_authority){
50
			getEntity().setAuthority(text_authority.getText());
51
		}
52
		
53
	}
54

    
55

    
56
	
57
}
(2-2/5)