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
> {
29 public TaxonNodeAgentRelationCollectionSection (CdmFormFactory formFactory
, ConversationHolder conversation
,
30 ICdmFormElement parentElement
, int style
) {
31 super(formFactory
, conversation
, parentElement
, "Related persons or teams", style
);
36 public String
getEmptyString() {
37 return "No related persons or teams yet.";
41 protected String
getTooltipString() {
42 return "Add a new person/team to this taxon node.";
46 public Collection
<TaxonNodeAgentRelation
> getCollection(TaxonNode entity
) {
47 //why Do I have to give the method an entity???
48 Collection
<TaxonNodeAgentRelation
> allAgentRelationships
= getEntity().getAgentRelations();
49 return allAgentRelationships
;
53 public void addElement(TaxonNodeAgentRelation element
) {
59 public void removeElement(TaxonNodeAgentRelation element
) {
60 getEntity().removeNodeAgent(element
);
61 // CdmStore.getService(ITaxonNodeService.class).deleteAgentrelation(element);
66 public TaxonNodeAgentRelation
createNewElement() {
67 TaxonNodeAgentRelation rel
= getEntity().addAgentRelation(null, null);
71 public boolean isComplete(){
80 public TaxonNodeAgentRelation
addExisting() {
88 public boolean allowAddExisting() {