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