Merged refactoring from development branch.
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / ui / selection / NomenclaturalAuthorTeamSelectionElement.java
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.Team;
17 import eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.NomenclaturalAuthorTeamSelectionDialog;
18 import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory;
19 import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
20
21 /**
22 * <p>NomenclaturalAuthorTeamSelectionElement class.</p>
23 *
24 * @author n.hoffmann
25 * @created Jun 22, 2010
26 * @version 1.0
27 */
28 public class NomenclaturalAuthorTeamSelectionElement extends AbstractSelectionElement<Team> {
29
30 /**
31 * <p>Constructor for NomenclaturalAuthorTeamSelectionElement.</p>
32 *
33 * @param formFactory a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory} object.
34 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
35 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement} object.
36 * @param labelString a {@link java.lang.String} object.
37 * @param entity a {@link eu.etaxonomy.cdm.model.agent.Team} object.
38 * @param style a int.
39 */
40 public NomenclaturalAuthorTeamSelectionElement(CdmFormFactory formFactory, ConversationHolder conversation,
41 ICdmFormElement parentElement, String labelString, Team entity, int style) {
42 super(formFactory, conversation, parentElement, labelString, entity,
43 true, true, true, style);
44 }
45
46 /** {@inheritDoc} */
47 @Override
48 protected String getTitle() {
49 return (entity != null) ? entity.getNomenclaturalTitle() : "";
50 }
51
52 /** {@inheritDoc} */
53 public void widgetSelected(SelectionEvent e) {
54 Team newSelection = (Team) NomenclaturalAuthorTeamSelectionDialog.select(getShell(), getConversationHolder(), entity);
55 setSelectionInternal(newSelection);
56 }
57 }