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
.grantedAuthority
;
12 import eu
.etaxonomy
.cdm
.model
.common
.GrantedAuthorityImpl
;
13 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
14 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
15 import eu
.etaxonomy
.taxeditor
.ui
.element
.TextWithLabelElement
;
16 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailElement
;
20 * @author a.kohlbecker
21 * @created Mar 9, 2011
24 public class GrantedAuthorityDetailElement
extends AbstractCdmDetailElement
<GrantedAuthorityImpl
> {
26 private TextWithLabelElement text_authority
;
32 public GrantedAuthorityDetailElement(CdmFormFactory formFactory
,
33 ICdmFormElement formElement
) {
34 super(formFactory
, formElement
);
38 protected void createControls(ICdmFormElement formElement
,
39 GrantedAuthorityImpl entity
, int style
) {
41 String labelText
= null;
42 if (entity
.getAuthority() != null){
43 labelText
= GrantedAuthorityLabelTextProvider
.getText(entity
);
45 text_authority
= formFactory
.createTextWithLabelElement(formElement
, "Authority", null, style
);
50 public void handleEvent(Object eventSource
) {
51 if(eventSource
== text_authority
){
52 getEntity().setAuthority(text_authority
.getText());