Project

General

Profile

Download (2.22 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.selection;
12

    
13
import org.eclipse.swt.events.SelectionEvent;
14

    
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.model.agent.Person;
17
import eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade;
18
import eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.PersonSelectionDialog;
19
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
20

    
21
/**
22
 * <p>
23
 * PersonSelectionElement class.
24
 * </p>
25
 * 
26
 * @author n.hoffmann
27
 * @created May 12, 2010
28
 * @version 1.0
29
 */
30
public class PersonSelectionElement extends AbstractSelectionElement<Person> {
31

    
32
	public static final int DEFAULT = EDITABLE | SELECTABLE;
33

    
34
	/**
35
	 * <p>
36
	 * Constructor for PersonSelectionElement.
37
	 * </p>
38
	 * 
39
	 * @param formFactory
40
	 *            a {@link eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade}
41
	 *            object.
42
	 * @param conversation
43
	 *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
44
	 *            object.
45
	 * @param parentElement
46
	 *            a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement}
47
	 *            object.
48
	 * @param labelString
49
	 *            a {@link java.lang.String} object.
50
	 * @param entity
51
	 *            a {@link eu.etaxonomy.cdm.model.agent.Person} object.
52
	 * @param style
53
	 *            a int.
54
	 */
55
	public PersonSelectionElement(CdmFormFactoryFacade formFactory,
56
			ConversationHolder conversation, ICdmFormElement parentElement,
57
			String labelString, Person entity, int mode, int style) {
58
		super(formFactory, conversation, parentElement, labelString, entity,
59
				mode, style);
60
	}
61

    
62
	/*
63
	 * (non-Javadoc)
64
	 * 
65
	 * @see
66
	 * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
67
	 * .events.SelectionEvent)
68
	 */
69
	/** {@inheritDoc} */
70
	@Override
71
	public void widgetSelected(SelectionEvent e) {
72
		Person newSelection = PersonSelectionDialog.select(getShell(),
73
				getConversationHolder(), entity);
74
		setSelectionInternal(newSelection);
75
	}
76
}
(15-15/24)