X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/blobdiff_plain/d086b1f5ed7565d37e96b4ca907321b526f9f07d..e30e9ca47a93e355e13b5ac27b885ac7c37af617:/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/name/TaxonBasePropertySource.java diff --git a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/name/TaxonBasePropertySource.java b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/name/TaxonBasePropertySource.java index dfe4907a7..64fc6ebc7 100644 --- a/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/name/TaxonBasePropertySource.java +++ b/eclipseprojects/eu.etaxonomy.taxeditor/src/eu/etaxonomy/taxeditor/propertysheet/name/TaxonBasePropertySource.java @@ -11,6 +11,7 @@ package eu.etaxonomy.taxeditor.propertysheet.name; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.Set; import java.util.Vector; import org.apache.log4j.Logger; @@ -25,10 +26,11 @@ import eu.etaxonomy.cdm.model.name.TaxonNameBase; import eu.etaxonomy.cdm.model.name.ZoologicalName; import eu.etaxonomy.cdm.model.reference.ReferenceBase; import eu.etaxonomy.cdm.model.taxon.TaxonBase; -import eu.etaxonomy.taxeditor.controller.GlobalController; import eu.etaxonomy.taxeditor.propertysheet.reference.IReferenceSearch; import eu.etaxonomy.taxeditor.propertysheet.reference.ReferencePropertySource; import eu.etaxonomy.taxeditor.propertysheet.reference.ReferenceSearchDescriptor; +import eu.etaxonomy.taxeditor.propertysheet.type.TypeCollectionPropertySource; +import eu.etaxonomy.taxeditor.propertysheet.type.TypePropertyDescriptor; /** * @author p.ciardelli @@ -44,16 +46,22 @@ public class TaxonBasePropertySource implements IPropertySource { // Property unique keys public static final String P_ID_TAXONNAME = "P_ID_TAXONNAME"; public static final String P_ID_TAXONSEC = "P_ID_TAXONSEC"; + public static final String P_ID_TYPES = "P_ID_TYPES"; // Property display keys - public static final String P_TAXONNAME = "00:Misapplied Name"; - public static final String P_TAXONSEC = "01:Sec"; + public String P_TAXONNAME; + public static final String P_TAXONSEC = "01:Secundum"; + public static final String P_TYPES = "02:Name Types"; - public TaxonBasePropertySource(TaxonBase taxon) { + + public TaxonBasePropertySource(TaxonBase taxon, String nameTitle) { this.taxon = taxon; + this.P_TAXONNAME = "00:" + nameTitle; + addDescriptor(P_ID_TAXONNAME); addDescriptor(P_ID_TAXONSEC); + addDescriptor(P_ID_TYPES); } protected Vector descriptors = new Vector(); @@ -70,6 +78,15 @@ public class TaxonBasePropertySource implements IPropertySource { } }); } + if (id.equals(P_ID_TYPES)) { + descriptors.addElement( + new TypePropertyDescriptor(P_ID_TYPES, P_TYPES, taxon.getName()) { + protected void saveTypes(Set set) { + setPropertyValue(P_ID_TYPES, set); + } + } + ); + }; } /* (non-Javadoc) @@ -141,6 +158,12 @@ public class TaxonBasePropertySource implements IPropertySource { return secPropertySource; } + if (id.equals(P_ID_TYPES)) { + if (taxon.getName() != null) { + return new TypeCollectionPropertySource(taxon.getName(), taxon.getName().getSpecimenTypeDesignations()); + } + } + return null; }