3 * Copyright (C) 2012 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
.section
.grantedAuthority
;
13 import org
.eclipse
.swt
.events
.SelectionListener
;
15 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
16 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.AbstractFormSection
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
23 * @author a.kohlbecker
27 public class GrantedAuthorityCollectionElement
extends AbstractEntityCollectionElement
<GrantedAuthorityImpl
> {
29 private EntitySelectionElement
<GrantedAuthorityImpl
> selection_authority
;
32 public GrantedAuthorityCollectionElement(CdmFormFactory formFactory
,
33 AbstractFormSection section
, GrantedAuthorityImpl entity
,
34 SelectionListener removeListener
, int style
) {
35 super(formFactory
, section
, entity
, removeListener
, null, style
);
36 // TODO Auto-generated constructor stub
40 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
43 public void setEntity(GrantedAuthorityImpl entity
) {
44 selection_authority
.setEntity(entity
);
49 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, int)
52 public void createControls(ICdmFormElement element
, int style
) {
53 selection_authority
= formFactory
.createSelectionElement(
54 GrantedAuthorityImpl
.class, getConversationHolder(), element
, "", getEntity(), EntitySelectionElement
.SELECTABLE
, style
);
58 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
61 public void handleEvent(Object eventSource
) {
62 if (eventSource
== selection_authority
) {
63 setEntity(selection_authority
.getEntity());