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
.eclipse
.jface
.viewers
.ISelectionProvider
;
16 import org
.springframework
.security
.core
.GrantedAuthority
;
18 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
19 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
20 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
.DetailType
;
22 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
23 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractCdmDetailSection
;
24 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
28 * @created Mar 9, 2011
31 public class GrantedAuthorityDetailSection
extends AbstractEntityCollectionSection
<Group
, GrantedAuthority
> {
36 * @param parentElement
40 public GrantedAuthorityDetailSection(CdmFormFactory formFactory
,
41 ConversationHolder conversation
, ICdmFormElement parentElement
,
43 super(formFactory
, conversation
, parentElement
, "Granted Authorities", style
);
47 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
50 public Collection
<GrantedAuthority
> getCollection(Group entity
) {
51 return entity
.getGrantedAuthorities();
55 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
58 public GrantedAuthority
createNewElement() {
59 GrantedAuthority selection
= null; // TODO GrantedAuthoritySelectionDialog.select(...);
64 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
67 public void addElement(GrantedAuthority element
) {
68 getEntity().addGrantedAuthority(element
);
72 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
75 public void removeElement(GrantedAuthority element
) {
76 getEntity().removeGrantedAuthority(element
);
80 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
83 public String
getEmptyString() {
84 return "No Granted Athorities yet.";
88 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
91 protected String
getTooltipString() {
92 return "Add a Granted Authority";