had to rename the packages to make them compliant with buckminster
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / group / GrantedAuthorityDetailSection.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.ui.section.group;
12
13 import java.util.Collection;
14
15 import org.eclipse.jface.viewers.ISelectionProvider;
16 import org.springframework.security.core.GrantedAuthority;
17
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;
25
26 /**
27 * @author n.hoffmann
28 * @created Mar 9, 2011
29 * @version 1.0
30 */
31 public class GrantedAuthorityDetailSection extends AbstractEntityCollectionSection<Group, GrantedAuthority> {
32
33 /**
34 * @param formFactory
35 * @param conversation
36 * @param parentElement
37 * @param title
38 * @param style
39 */
40 public GrantedAuthorityDetailSection(CdmFormFactory formFactory,
41 ConversationHolder conversation, ICdmFormElement parentElement,
42 int style) {
43 super(formFactory, conversation, parentElement, "Granted Authorities", style);
44 }
45
46 /* (non-Javadoc)
47 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
48 */
49 @Override
50 public Collection<GrantedAuthority> getCollection(Group entity) {
51 return entity.getGrantedAuthorities();
52 }
53
54 /* (non-Javadoc)
55 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
56 */
57 @Override
58 public GrantedAuthority createNewElement() {
59 GrantedAuthority selection = null; // TODO GrantedAuthoritySelectionDialog.select(...);
60 return selection;
61 }
62
63 /* (non-Javadoc)
64 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
65 */
66 @Override
67 public void addElement(GrantedAuthority element) {
68 getEntity().addGrantedAuthority(element);
69 }
70
71 /* (non-Javadoc)
72 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
73 */
74 @Override
75 public void removeElement(GrantedAuthority element) {
76 getEntity().removeGrantedAuthority(element);
77 }
78
79 /* (non-Javadoc)
80 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
81 */
82 @Override
83 public String getEmptyString() {
84 return "No Granted Athorities yet.";
85 }
86
87 /* (non-Javadoc)
88 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
89 */
90 @Override
91 protected String getTooltipString() {
92 return "Add a Granted Authority";
93 }
94
95
96 }