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 java
.util
.Collection
;
14 import org
.springframework
.security
.core
.GrantedAuthority
;
16 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
17 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
18 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.GrantedAuthoritySelectionDialog
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
25 * @created Mar 9, 2011
28 public class GrantedAuthorityDetailSection
extends
29 AbstractEntityCollectionSection
<Group
, GrantedAuthority
> {
34 * @param parentElement
38 public GrantedAuthorityDetailSection(CdmFormFactory formFactory
,
39 ConversationHolder conversation
, ICdmFormElement parentElement
,
41 super(formFactory
, conversation
, parentElement
, "Granted Authorities",
48 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
49 * getCollection(java.lang.Object)
52 public Collection
<GrantedAuthority
> getCollection(Group entity
) {
53 return entity
.getGrantedAuthorities();
59 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
63 public GrantedAuthority
createNewElement() {
65 // .warningDialog("Not implemented yet", getClass(),
66 // "This functionality needs to be implemented in CDM Library first.");
68 GrantedAuthority selection
= GrantedAuthoritySelectionDialog
.select(getLayoutComposite().getShell(), getConversationHolder(), null);
76 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
80 public void addElement(GrantedAuthority element
) {
81 getEntity().addGrantedAuthority(element
);
87 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
88 * removeElement(java.lang.Object)
91 public void removeElement(GrantedAuthority element
) {
92 getEntity().removeGrantedAuthority(element
);
98 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
102 public String
getEmptyString() {
103 return "No Granted Authorities yet.";
109 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
113 protected String
getTooltipString() {
114 return "Add a Granted Authority";
121 public GrantedAuthority
addExisting() {
122 System
.err
.println("Test");
130 public boolean allowAddExisting() {