Project

General

Profile

Download (2.26 KB) Statistics
| Branch: | Tag: | Revision:
1 2d9a13f7 n.hoffmann
/**
2 f561b00c n.hoffmann
 * Copyright (C) 2007 EDIT
3 6ed48b2e Patrick Plitzner
 * European Distributed Institute of Taxonomy
4 f561b00c n.hoffmann
 * http://www.e-taxonomy.eu
5 6ed48b2e Patrick Plitzner
 *
6 f561b00c n.hoffmann
 * 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 2d9a13f7 n.hoffmann
10 f211dd28 n.hoffmann
package eu.etaxonomy.taxeditor.ui.selection;
11 2d9a13f7 n.hoffmann
12
import org.eclipse.swt.events.SelectionEvent;
13
14
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
15
import eu.etaxonomy.cdm.model.agent.Team;
16 78222507 n.hoffmann
import eu.etaxonomy.taxeditor.ui.dialog.selection.NomenclaturalAuthorTeamSelectionDialog;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18 dacb59c9 Patric Plitzner
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
19 2d9a13f7 n.hoffmann
20
/**
21 f561b00c n.hoffmann
 * <p>
22
 * NomenclaturalAuthorTeamSelectionElement class.
23
 * </p>
24 6ed48b2e Patrick Plitzner
 *
25 2d9a13f7 n.hoffmann
 * @author n.hoffmann
26
 * @created Jun 22, 2010
27
 * @version 1.0
28
 */
29 f561b00c n.hoffmann
public class NomenclaturalAuthorTeamSelectionElement extends
30 23783f7a n.hoffmann
		EntitySelectionElement<Team> {
31 f561b00c n.hoffmann
32
	public static final int DEFAULT = EDITABLE | SELECTABLE | DELETABLE;
33 2d9a13f7 n.hoffmann
34 3be6ef3e n.hoffmann
	/**
35 f561b00c n.hoffmann
	 * <p>
36
	 * Constructor for NomenclaturalAuthorTeamSelectionElement.
37
	 * </p>
38 6ed48b2e Patrick Plitzner
	 *
39 f561b00c n.hoffmann
	 * @param formFactory
40 78222507 n.hoffmann
	 *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
41 f561b00c n.hoffmann
	 *            object.
42
	 * @param conversation
43
	 *            a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
44
	 *            object.
45
	 * @param parentElement
46 78222507 n.hoffmann
	 *            a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
47 f561b00c n.hoffmann
	 *            object.
48
	 * @param labelString
49
	 *            a {@link java.lang.String} object.
50
	 * @param entity
51
	 *            a {@link eu.etaxonomy.cdm.model.agent.Team} object.
52
	 * @param style
53
	 *            a int.
54 3be6ef3e n.hoffmann
	 */
55 f561b00c n.hoffmann
	public NomenclaturalAuthorTeamSelectionElement(CdmFormFactory formFactory,
56
			ConversationHolder conversation, ICdmFormElement parentElement,
57
			String labelString, Team entity, int mode, int style) {
58 6ed48b2e Patrick Plitzner
		super(formFactory, conversation, parentElement, Team.class, labelString, entity,
59 f561b00c n.hoffmann
				mode, style);
60 2d9a13f7 n.hoffmann
	}
61 f561b00c n.hoffmann
62 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
63 2d9a13f7 n.hoffmann
	@Override
64
	protected String getTitle() {
65
		return (entity != null) ? entity.getNomenclaturalTitle() : "";
66
	}
67 f561b00c n.hoffmann
68 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
69 f561b00c n.hoffmann
	@Override
70 2d9a13f7 n.hoffmann
	public void widgetSelected(SelectionEvent e) {
71 f561b00c n.hoffmann
		Team newSelection = NomenclaturalAuthorTeamSelectionDialog.select(
72
				getShell(), getConversationHolder(), entity);
73 2d9a13f7 n.hoffmann
		setSelectionInternal(newSelection);
74
	}
75
}