Project

General

Profile

Download (2.21 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2012 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 org.eclipse.swt.events.SelectionListener;
13

    
14
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
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
 * @author a.kohlbecker
23
 * @date Sept 12 2012
24
 *
25
 */
26
public class GrantedAuthorityCollectionElement extends AbstractEntityCollectionElement<GrantedAuthorityImpl> {
27
	
28
	private EntitySelectionElement<GrantedAuthorityImpl> selection_authority;
29

    
30

    
31
	public GrantedAuthorityCollectionElement(CdmFormFactory formFactory,
32
			AbstractFormSection section, GrantedAuthorityImpl entity,
33
			SelectionListener removeListener, int style) {
34
		super(formFactory, section, entity, removeListener, null, style);		
35
		// TODO Auto-generated constructor stub
36
	}
37

    
38
	/* (non-Javadoc)
39
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
40
	 */
41
	@Override
42
	public void setEntity(GrantedAuthorityImpl entity) {
43
		selection_authority.setEntity(entity);
44
		
45
	}
46

    
47
	/* (non-Javadoc)
48
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, int)
49
	 */
50
	@Override
51
	public void createControls(ICdmFormElement element, int style) {
52
		selection_authority = formFactory.createSelectionElement(
53
					GrantedAuthorityImpl.class, getConversationHolder(), element, "", getEntity(), EntitySelectionElement.SELECTABLE, style);
54
	}
55

    
56
	/* (non-Javadoc)
57
	 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
58
	 */
59
	@Override
60
	public void handleEvent(Object eventSource) {
61
		if (eventSource == selection_authority) {
62
			setEntity(selection_authority.getEntity());
63
		}
64
	}
65

    
66

    
67
}
(1-1/5)