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