2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.group
;
12 import org
.eclipse
.swt
.events
.SelectionListener
;
14 import eu
.etaxonomy
.cdm
.model
.permission
.User
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
23 * @created Mar 9, 2011
26 public class MemberDetailElement
extends AbstractEntityCollectionElement
<User
> {
28 private EntitySelectionElement
<User
> selection_user
;
34 * @param removeListener
35 * @param backgroundColor
38 public MemberDetailElement(CdmFormFactory formFactory
,
39 AbstractFormSection section
, User entity
,
40 SelectionListener removeListener
, int style
) {
41 super(formFactory
, section
, entity
, removeListener
, null, style
);
48 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity
52 public void setEntity(User entity
) {
54 if (selection_user
!= null){
55 selection_user
.setEntity(entity
);
62 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#
63 * createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, int)
66 public void createControls(ICdmFormElement element
, int style
) {
67 selection_user
= formFactory
68 .createSelectionElement(User
.class,
70 EntitySelectionElement
.EDITABLE
, style
);
80 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent
84 public void handleEvent(Object eventSource
) {
85 if (eventSource
== selection_user
) {
86 setEntity(selection_user
.getEntity());