merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Jan 2014 16:15:13 +0000 (16:15 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Jan 2014 16:15:13 +0000 (16:15 +0000)
1  2 
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java

index 627c140aa66ba82c4ee7a7e43bc10504268833b0,0ccb5a341af8789ba530183667a1f4b102116822..0d8f350763b87d9a357878f8893d44a74d810b11
@@@ -71,29 -90,6 +71,29 @@@ public class NewDerivedUnitBaseWizard e
            }
        }
  
-                 return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
 +    /*
 +     * (non-Javadoc)
 +     *
 +     * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#
 +     * createNewEntity()
 +     */
 +    /** {@inheritDoc} */
 +    @Override
 +    protected SpecimenOrObservationBase createNewEntity() {
 +        if (specOrObsType == null) {
 +            return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
 +        } else {
 +            if (SpecimenOrObservationType.Media.equals(specOrObsType)
 +                    || ((specOrObsType.getKindOf() != null) && specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
++                  return MediaSpecimen.NewInstance(specOrObsType);
 +            } else if (specOrObsType.equals(SpecimenOrObservationType.FieldUnit)) {
 +                return FieldUnit.NewInstance();
 +            } else {
 +                return DerivedUnit.NewInstance(specOrObsType);
 +            }
 +        }
 +    }
 +
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
         */
index ddb0bf7904c32fb4ce0ad3d46cfbbd1734585c9e,9cdcf2ce6df306e49a7d95d786730010e285df1c..717fd4f0da85cd90a09308d152402ab4b9c22ce9
@@@ -19,6 -18,8 +19,7 @@@ import eu.etaxonomy.taxeditor.ui.campan
  import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
  import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
  import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
 -import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+ import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
  import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
  import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  
  public class TaxonRelationshipDetailElement extends AbstractCdmDetailElement<TaxonRelationship> {
  
        private TermComboElement<TaxonRelationshipTypeInverseContainer> combo_taxonRelationshipType;
 -
 +      
        private EntitySelectionElement<Taxon> selection_relatedTaxon;
 -
 +      
+       private CheckboxElement checkBoxDoubtful;
        public TaxonRelationshipDetailElement(CdmFormFactory formFactory,
                        ICdmFormElement formElement) {
                super(formFactory, formElement);
                                getTaxonRelationshipTypeInverseContainer(), style);
                combo_taxonRelationshipType.setEnabled(false);
                selection_relatedTaxon = formFactory.createSelectionElement(
 -                              Taxon.class, getConversationHolder(),
 -                              formElement, "Related Taxon", getRelatedTaxon(),
 +                              Taxon.class, getConversationHolder(), 
 +                              formElement, "Related Taxon", getRelatedTaxon(), 
                                EntitySelectionElement.SELECTABLE, style);
+               checkBoxDoubtful = formFactory.createCheckbox(formElement, "Relation is doubtful", entity.isDoubtful(), style);
        }
 -
 +      
        private Taxon getRelatedTaxon() {
                return TaxonRelationshipTypeInverseContainer.RelatedTaxon(getSourceTaxon(), getEntity());
        }