Project

General

Profile

« Previous | Next » 

Revision aeb80bf1

Added by Andreas Müller over 3 years ago

cleanup

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamMemberElement.java
6 6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
 * See LICENSE.TXT at the top of this package for the full license terms.
8 8
 */
9

  
10 9
package eu.etaxonomy.taxeditor.ui.section.agent;
11 10

  
12 11
import org.eclipse.swt.events.SelectionListener;
......
23 22
/**
24 23
 * @author n.hoffmann
25 24
 * @created Apr 30, 2010
26
 * @version 1.0
27 25
 */
28 26
public class TeamMemberElement extends AbstractEntityCollectionElement<Person> {
29 27

  
30 28
	private EntitySelectionElement<Person> selection_person;
31
	private final boolean isNomenclatural;
32 29

  
33 30
	public TeamMemberElement(CdmFormFactory cdmFormFactory,
34 31
			AbstractFormSection section, Person entity,
35 32
			SelectionListener removeListener, int style, boolean isNomenclatural) {
36 33
		super(cdmFormFactory, section, entity, removeListener, null, style);
37
		this.isNomenclatural =isNomenclatural;
38

  
39 34
	}
40 35

  
41
	/** {@inheritDoc} */
42 36
	@Override
43 37
	public void createControls(ICdmFormElement element, int style) {
44 38
		selection_person = formFactory
45 39
				.createSelectionElement(Person.class,
46
						//getConversationHolder(),
47 40
				        this, "Person", null,
48 41
						EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE,
49 42
						style);
50 43
	}
51 44

  
52
	/** {@inheritDoc} */
53 45
	@Override
54 46
	public void setEntity(Person entity) {
55 47
		this.entity = entity;
56 48
		selection_person.setEntity(entity);
57 49
	}
58 50

  
59
	/** {@inheritDoc} */
60 51
    @Override
61 52
    public void handleEvent(Object eventSource) {
62 53
        if (eventSource == selection_person) {
......
71 62
                }
72 63
                else{
73 64
                    //first remove the edited team member and then add it again
74
                    //because the model allows the same person multiple time in on team
65
                    //because the model allows the same person multiple time in one team
75 66
                    team.removeTeamMember(getEntity());
76 67
                    team.addTeamMember(selection_person.getEntity(), index);
77 68
                }
......
80 71
            entity = selection_person.getEntity();
81 72
        }
82 73
    }
83
}
74
}

Also available in: Unified diff