MarkerType TermEditor was opening the Feature Editor
[taxeditor.git] / eu.etaxonomy.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.dialog.selection.InstitutionSelectionDialog;
18 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
19 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
20
21 /**
22 * <p>
23 * InstitutionSelectionElement class.
24 * </p>
25 *
26 * @author n.hoffmann
27 * @created Nov 17, 2009
28 * @version 1.0
29 */
30 public class InstitutionSelectionElement extends
31 AbstractSelectionElement<Institution> {
32
33 public static final int DEFAULT = EDITABLE | SELECTABLE | DELETABLE;
34
35 /**
36 * <p>
37 * Constructor for InstitutionSelectionElement.
38 * </p>
39 *
40 * @param labelString
41 * a {@link java.lang.String} object.
42 * @param selection
43 * a {@link eu.etaxonomy.cdm.model.agent.Institution} object.
44 * @param style
45 * a int.
46 * @param toolkit
47 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
48 * object.
49 * @param conversation
50 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
51 * object.
52 * @param parentElement
53 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
54 * object.
55 */
56 public InstitutionSelectionElement(CdmFormFactory toolkit,
57 ConversationHolder conversation, ICdmFormElement parentElement,
58 String labelString, Institution selection, int mode, int style) {
59 super(toolkit, conversation, parentElement, labelString, selection,
60 mode, style);
61 }
62
63 /** {@inheritDoc} */
64 @Override
65 public void widgetSelected(SelectionEvent e) {
66 Institution newSelection = InstitutionSelectionDialog.select(
67 getShell(), getConversationHolder(), entity);
68 setSelectionInternal(newSelection);
69 }
70 }