2 * Copyright (C) 2016 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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.classification
;
11 import java
.util
.Collection
;
13 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
14 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
15 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNodeAgentRelation
;
16 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
25 public class TaxonNodeAgentRelationCollectionSection
extends AbstractEntityCollectionSection
<TaxonNode
, TaxonNodeAgentRelation
> {
32 * @param parentElement
36 public TaxonNodeAgentRelationCollectionSection (CdmFormFactory formFactory
, ConversationHolder conversation
,
37 ICdmFormElement parentElement
, int style
) {
38 super(formFactory
, conversation
, parentElement
, "Related persons or teams", style
);
43 public String
getEmptyString() {
44 return "No related persons or teams yet.";
48 protected String
getTooltipString() {
49 return "Add a new person/team to this taxon node.";
53 public Collection
<TaxonNodeAgentRelation
> getCollection(TaxonNode entity
) {
54 //why Do I have to give the method an entity???
55 Collection
<TaxonNodeAgentRelation
> allAgentRelationships
= getEntity().getAgentRelations();
56 return allAgentRelationships
;
60 public void addElement(TaxonNodeAgentRelation element
) {
66 public void removeElement(TaxonNodeAgentRelation element
) {
67 getEntity().removeNodeAgent(element
);
68 // CdmStore.getService(ITaxonNodeService.class).deleteAgentrelation(element);
73 public TaxonNodeAgentRelation
createNewElement() {
74 TaxonNodeAgentRelation rel
= getEntity().addAgentRelation(null, null);
78 public boolean isComplete(){