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
.section
.group
;
13 import java
.util
.Collection
;
15 import org
.springframework
.security
.core
.GrantedAuthority
;
17 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
18 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
19 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
22 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
26 * @created Mar 9, 2011
29 public class GrantedAuthorityDetailSection
extends
30 AbstractEntityCollectionSection
<Group
, GrantedAuthority
> {
35 * @param parentElement
39 public GrantedAuthorityDetailSection(CdmFormFactory formFactory
,
40 ConversationHolder conversation
, ICdmFormElement parentElement
,
42 super(formFactory
, conversation
, parentElement
, "Granted Authorities",
49 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
50 * getCollection(java.lang.Object)
53 public Collection
<GrantedAuthority
> getCollection(Group entity
) {
54 return entity
.getGrantedAuthorities();
60 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
64 public GrantedAuthority
createNewElement() {
66 .warningDialog("Not implemented yet", getClass(),
67 "This functionality needs to be implemented in CDM Library first.");
68 // TODO GrantedAuthoritySelectionDialog.select(...);
69 GrantedAuthority selection
= null;
77 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
81 public void addElement(GrantedAuthority element
) {
82 getEntity().addGrantedAuthority(element
);
88 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
89 * removeElement(java.lang.Object)
92 public void removeElement(GrantedAuthority element
) {
93 getEntity().removeGrantedAuthority(element
);
99 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
103 public String
getEmptyString() {
104 return "No Granted Athorities yet.";
110 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
114 protected String
getTooltipString() {
115 return "Add a Granted Authority";