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
, "TaxonNode Agent Relation", style
);
45 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getEmptyString()
48 public String
getEmptyString() {
49 return "No taxon node agent relations yet.";
53 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getTooltipString()
56 protected String
getTooltipString() {
57 return "Add a new agent relation to this taxon node.";
61 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
64 public Collection
<TaxonNodeAgentRelation
> getCollection(TaxonNode entity
) {
65 //why Do I have to give the method an entity???
66 Collection
<TaxonNodeAgentRelation
> allAgentRelationships
= getEntity().getAgentRelations();
67 return allAgentRelationships
;
71 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement(java.lang.Object)
74 public void addElement(TaxonNodeAgentRelation element
) {
80 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#removeElement(java.lang.Object)
83 public void removeElement(TaxonNodeAgentRelation element
) {
84 getEntity().removeNodeAgent(element
);
85 // CdmStore.getService(ITaxonNodeService.class).deleteAgentrelation(element);
90 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#createNewElement()
93 public TaxonNodeAgentRelation
createNewElement() {
94 TaxonNodeAgentRelation rel
= getEntity().addAgentRelation(null, null);
98 public boolean isComplete(){