3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.forms
.selection
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.swt
.events
.SelectionEvent
;
16 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
18 import eu
.etaxonomy
.taxeditor
.dialogs
.filteredSelection
.FilteredAgentSelectionDialog
;
19 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
23 * <p>AgentSelectionElement class.</p>
26 * @created Jun 22, 2010
29 public class AgentSelectionElement
extends AbstractSelectionElement
<AgentBase
> {
32 private static final Logger logger
= Logger
33 .getLogger(AgentSelectionElement
.class);
36 * <p>Constructor for AgentSelectionElement.</p>
38 * @param formFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
39 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
40 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
41 * @param labelString a {@link java.lang.String} object.
42 * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
45 public AgentSelectionElement(CdmFormFactory formFactory
, ConversationHolder conversation
,
46 ICdmFormElement parentElement
, String labelString
,
47 AgentBase entity
, int style
) {
48 super(formFactory
, conversation
, parentElement
, labelString
, entity
,
49 true, true, true, style
);
53 public void widgetSelected(SelectionEvent e
) {
54 AgentBase newSelection
= (AgentBase
) FilteredAgentSelectionDialog
.select(getShell(), getConversationHolder(), entity
);
55 setSelectionInternal(newSelection
);