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
.ui
.selection
;
13 import org
.eclipse
.swt
.events
.SelectionEvent
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.common
.User
;
17 import eu
.etaxonomy
.taxeditor
.ui
.dialogs
.filteredSelection
.UserSelectionDialog
;
18 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
23 * @created Mar 10, 2011
26 public class UserSelectionElement
extends AbstractSelectionElement
<User
> {
28 public static final int DEFAULT
= NOTHING
;
33 * @param parentElement
41 public UserSelectionElement(CdmFormFactory formFactory
,
42 ConversationHolder conversation
, ICdmFormElement parentElement
,
43 String labelString
, User entity
, int mode
, int style
) {
44 super(formFactory
, conversation
, parentElement
, labelString
, entity
,
52 * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
53 * .events.SelectionEvent)
56 public void widgetSelected(SelectionEvent e
) {
57 User newSelection
= UserSelectionDialog
.select(getShell(),
58 getConversationHolder(), entity
);
59 setSelectionInternal(newSelection
);
66 * eu.etaxonomy.taxeditor.ui.selection.AbstractSelectionElement#getTitle()
69 protected String
getTitle() {
70 return (entity
!= null) ? entity
.getUsername() : "NO USER";