ref #10138: after parsing send event to update the details view
authorKatja Luther <k.luther@bgbm.org>
Fri, 16 Dec 2022 15:19:35 +0000 (16:19 +0100)
committerKatja Luther <k.luther@bgbm.org>
Fri, 16 Dec 2022 15:19:35 +0000 (16:19 +0100)
100 files changed:
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/container/AbstractGroupedContainer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractIdentifiableEntityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/EmptyElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/ITaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/InstitutionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/PersonDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/agent/TeamDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/ClassificationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/common/ReferenceEntityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/NaturalLanguageDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/AbstractDetailedDescriptionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/CategoricalDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/CommonNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/DistributionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/IndividualsAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/QuantitativeDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TaxonInteractionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TemporalDataDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/detail/TextDataDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDtoDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterDtoDetailSection.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDtoDetailElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/CharacterNodeDtoDetailSection.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/FeatureDistributionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/InapplicableIfEntityCollectionSectionForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/OnlyApplicableIfEntityCollectionSectionForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailElementForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/feature/TermTreeDetailSectionForNode.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/group/GroupDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/key/PolytomousKeyNodeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/AuthorshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/HybridDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NomenclaturalStatusSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NonViralNameDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/RuleConsideredElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/TypeDesignationSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/operation/DeleteTypeDesignationOperation.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/CollectionDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitMediaSection.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitFacadeDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitFacadeGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/TaxonAssociationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationCloningDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGelPhotoDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationPrimerDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/PrimerGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SingleReadGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/TissueSampleGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/media/MediaSpecimenGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/AdvancedSourceElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/NomenclaturalSourceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/OriginalSourceElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/ReferenceDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SecundumSourceDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/reference/SecundumSourceElement.java [changed mode: 0755->0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/ParsingMessagesSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonOfRelationshipElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/user/UserDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/userecords/UseRecordDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmDataViewer.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java

index 15d09712799f8321774631aece616c071efbcfc0..3f38217294c73fc9dcf731274d2706110fbe3d3f 100755 (executable)
@@ -62,6 +62,8 @@ import eu.etaxonomy.taxeditor.editor.name.e4.TaxonEditor;
 import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDragListenerE4;
 import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDragSourceEffect;
 import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInNewGroupOperation;
+import eu.etaxonomy.taxeditor.event.EventUtility;
+import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IElementHasDetails;
 import eu.etaxonomy.taxeditor.model.NameHelper;
@@ -113,6 +115,8 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
        private LineBreakListener lineBreakListener;
 
        private int cursorPosition;
+       
+       private long lastEventTime;
 
        protected Composite control;
 
@@ -150,21 +154,23 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                nameCompositeModifyListener = (ModifyEvent e)->{
                                // mark the composite dirty
                                setDirty(true);
-
+                               lastEventTime = System.currentTimeMillis();
                                // parse the text
                                String text = nameViewer.getTextWidget().getText();
 
                                TaxonName name = (TaxonName)parseHandler.parse(text);
                                getTaxonBase().setName(name);
                                getTaxonBase().setTitleCache((getTaxonBase().generateTitle()));
-//                             EventUtility.postAsyncEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
+                               
 
                                // show errors resulting from parsing
                                calculateAnnotations();
                                // store the position of the cursor
                                storeCursor();
                                // notify selection listener
-                               setDelayedSelection();
+                               setDelayedSelection();          
+                               //EventUtility.postAsyncEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
+                               
                };
 
                nameCompositeFocusListener = new FocusAdapter() {
@@ -173,6 +179,7 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                        public void focusLost(FocusEvent e) {
                                super.focusLost(e);
                                persistName();
+                               EventUtility.postAsyncEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
                        }
                };
 
@@ -604,7 +611,6 @@ abstract public class AbstractGroupedContainer<T extends TaxonBase> implements
                delay.requestStop();
                delay = new Delay(display);
                delay.start();
-
        }
 
        public void setBackground(Color color) {
index f1f880592ec2b3fcd19960b1eb1c978d4664b779..92daba370a16d05a476fe044f90b2f4ee4eccd51 100644 (file)
@@ -57,4 +57,9 @@ public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUn
         }
     }
 
+       @Override
+       public void fillFields() {
+               textOriginalLabel.setText(getEntity().getOriginalLabelInfo());          
+       }
+
 }
index 6241b28a09aae4e612764d2a4d408842dd1c534a..d7b941465bb201d312cff0ed04d1604532fc3efe 100644 (file)
@@ -85,14 +85,10 @@ public abstract class AbstractCdmDetailElement<T>
 
        public void setEntityWithoutUpdate(T entity){
            this.entity = entity;
-        // the id is always 0 if the entity was not yet saved, so it is new in this case
-        if(getEntity() == null || (getEntity() instanceof CdmBase && StoreUtil.getCdmEntity(getEntity()).getId() == 0)) {
-            // new entity, not yet saved
-            requiredCrud = EnumSet.of(CRUD.CREATE);
-        } else {
-            requiredCrud = EnumSet.of(CRUD.UPDATE);
-        }
+        fillFields();
        }
+       
+       public abstract void fillFields();
 
        @Override
     public T getEntity() {
index b13168eebbb22645da09d921002e6289f1ffaf3c..710d89797306c83083b44bc16b2e7d3748672f5b 100644 (file)
@@ -170,6 +170,17 @@ public abstract class AbstractCdmDetailSection<ENTITY>
                setSectionTitle();
                layout();
        }
+       
+       public void setEntityWithoutUpdate(ENTITY entity) {
+
+               if (detailElement != null) {
+                       detailElement.fillFields();
+
+               }
+               super.setEntity(entity);
+               setSectionTitle();
+
+       }
 
        protected void setSectionTitle() {
                String title = "";
index 5d31a9c811faa669621cd9636f75d4636e16a288..0b1f2216a87966501e1bca6677acf41f01782d10 100644 (file)
@@ -62,4 +62,12 @@ public abstract class AbstractIdentifiableEntityDetailElement<T extends IIdentif
     protected void registerCacheRelevance(ICacheRelevantFormElement element) {
         registerCacheRelevance(element, toggleable_cache);
     }
+    
+    @Override
+    public void fillFields() {
+       if (!getEntity().getTitleCache().equals(toggleable_cache.getText())) {
+               toggleable_cache.setText(getEntity().getTitleCache());
+               toggleable_cache.setSelected(getEntity().isProtectedTitleCache());
+       }       
+    }
 }
\ No newline at end of file
index b6ade7f2aa776578bea62f3d613bcbc3e7945164..f82a0ff4a71836a4317be57b9e463fc4db461471 100644 (file)
@@ -50,4 +50,9 @@ public class EmptyElement extends AbstractCdmDetailElement{
        public void setEntity(Object entity) {
            // nothing
        }
+
+       @Override
+       public void fillFields() {
+               // do nothing           
+       }
 }
index 69a7ee6b25ed7dedf492d4b273f272d3a8679359..bbac3c2f74bc811f824310163c271fddaa9ddc5a 100644 (file)
@@ -15,6 +15,8 @@ public interface ITaxonBaseDetailSection{
         * @param taxon a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
         */
        public abstract void setTaxonBase(TaxonBase<?> taxon);
+       
+       public abstract void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon);
 
        public abstract TaxonBase<?> getTaxonBase();
 }
index bf3107b495a12a32b31db39dc0f288bc8fe88e32..e61023bba9431dabdacd694bda145ef69bd8191d 100644 (file)
@@ -63,4 +63,14 @@ public class InstitutionDetailElement extends
                        getEntity().setIsPartOf(selection_partOfInstitution.getSelection());
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       text_name.setText(getEntity().getName());
+                       text_code.setText(getEntity().getCode());
+                       selection_partOfInstitution.setEntity(getEntity().getIsPartOf());
+               }
+               
+       }
 }
\ No newline at end of file
index 5a27b25081f2046492d1a813a65626a762d5a063..9439e22c960f70d6ad7604ae2e9272e7cb9fa8a1 100644 (file)
@@ -161,4 +161,23 @@ public class PersonDetailElement extends AbstractIdentifiableEntityDetailElement
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       text_nomenclaturalTitle.setText(getEntity().getNomenclaturalTitle()); 
+                       toggleable_cache.setText(getEntity().getTitleCache());
+                       toggleable_cache.setCacheEnabled(getEntity().isProtectedTitleCache());
+                       text_collectorTitle.setText(getEntity().getCollectorTitle());
+                       text_firstname.setText(getEntity().getGivenName());
+                       text_lastname.setText(getEntity().getFamilyName());
+                       text_prefix.setText(getEntity().getPrefix());
+                       text_suffix.setText(getEntity().getSuffix());
+                       text_initials.setText(getEntity().getInitials());
+                       time_lifespan.setTimePeriod(getEntity().getLifespan()!= null? getEntity().getLifespan(): null);
+                       text_orcid.setText(getEntity().getOrcid() != null? getEntity().getOrcid().toString(): null);
+                       text_lsid.setText(getEntity().getLsid()!= null? getEntity().getLsid().toString(): null);
+               }
+               
+       }
 }
\ No newline at end of file
index 6186783273b92631a7561ea252ae880741023863..a18bb0c95bf32af3944f420290141630ef063af6 100644 (file)
@@ -143,4 +143,17 @@ public class TeamDetailElement
     public void setNomenclaturalTeam(boolean isNomenclaturalTeam) {
         this.isNomenclaturalTeam = isNomenclaturalTeam;
     }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       toggleable_nomenclaturalTitleCache.setText(getEntity().getNomenclaturalTitleCache());
+                       toggleable_collectorTitleCache.setText(getEntity().getCollectorTitleCache());
+                       hasAdditionalMembers.setEnabled(getEntity().isHasMoreMembers());
+       
+                       section_teamMembers.setEntity(getEntity());
+                       
+               }
+               
+       }
 }
\ No newline at end of file
index 87e24e9e18a582c0b5eb4632f31b88dadaa773ea..c1c8455d892362717620b5b043a52282cc303153 100644 (file)
@@ -77,4 +77,16 @@ public class ClassificationDetailElement extends
             getEntity().setTimeperiod(element_date.getTimePeriod());
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       text_treeLabel.setText(getEntity().getName().getText());
+                       selection_reference.setEntity(getEntity().getReference());
+                       text_microReference.setText(getEntity().getMicroReference());
+                       element_date.setEntity(getEntity().getTimeperiod()!= null? getEntity().getTimeperiod(): null);;
+                       section_collectingAreas.setEntity(getEntity());
+               }
+               
+       }
 }
\ No newline at end of file
index 9ef5fad361631fce5aab412479841515cbff25bf..eaab161c2e0ae55f2279f98a0607888329304ed0 100644 (file)
@@ -331,7 +331,7 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
                            }
                        }
                        if (checkbox_publish != null){
-                           checkbox_publish.setSelected(getTaxon().isPublish());
+                           checkbox_publish.setSelection(getTaxon().isPublish());
                        }
             }else{
                 if (isCreateNew()){
@@ -581,4 +581,31 @@ public class TaxonNodeDetailElement extends AbstractSingleSourceElement<TaxonNod
         // TODO Auto-generated method stub
         return null;
     }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       if (selection_parentTaxonNode!= null) {
+                               selection_parentTaxonNode.setEntity(getEntity().getParent());
+                       }
+                       if (selection_reuseExistingTaxon != null) {
+                               selection_reuseExistingTaxon.setEntity(getEntity().getTaxon());
+                       }
+                       if (selection_reuseExistingName!= null) {
+                               selection_reuseExistingName.setEntity(getEntity().getTaxon() != null?getEntity().getTaxon().getName(): null);
+                       }
+                       if (selection_SecRef != null) {
+                               selection_SecRef.setEntity(getEntity().getTaxon() != null?getEntity().getTaxon().getSec(): null);
+                       }else {
+                               textTaxonSec.setText(getEntity().getTaxon() != null?getEntity().getTaxon().getSec().getTitle():null);
+                       }
+                       microReference.setText(getEntity().getTaxon() != null? getEntity().getTaxon().getSecMicroReference(): null);
+                       textNewTaxonName.setText(getEntity().getTaxon() != null? getEntity().getTaxon().getName().getTitleCache():null);
+                       selectionNodeAgentRelation.setEntity(getEntity());
+                       combo_status.setSelection(getEntity().getStatus());
+                       this.set_publish(taxon.isPublish());
+                       multiLanguageTextPlacementNotes.setMultilanguageText(getEntity().getStatusNote());
+               }
+               
+       }
 }
index b20d64ec7f96e1e6cc47514852fea2beb0b3f9ac..ce28c85e2785a3b62415f1d19d3b19f0f3f98247 100644 (file)
@@ -53,4 +53,11 @@ public class ReferenceEntityDetailElement extends AbstractCdmDetailElement<Singl
                }
        }
 
+       @Override
+       public void fillFields() {
+               selection_reference.setEntity(getEntity().getCitation());
+               text_referenceDetail.setText(getEntity().getCitationMicroReference());
+               
+       }
+
 }
index 9a044ea82655010d0b39d73cd07cedaf991f4ebe..0d99764aa1cf61f7fbbfa8f8b5ac7567d38c39f1 100644 (file)
@@ -73,4 +73,10 @@ public class DescriptionElementDetailElement extends
         }
         setEnabled(enabled, except);
     }
+
+       @Override
+       public void fillFields() {
+               // TODO actually not used
+               
+       }
 }
index 70425aab08b25594c21aef468fc880b01abdc07c..a3ca50ababb47bf81778d53a766e1141458410be 100644 (file)
@@ -120,4 +120,15 @@ public class NaturalLanguageDetailElement extends AbstractCdmDetailElement<Taxon
                }
 
        }
+
+       @Override
+       public void fillFields() {
+               if(getEntity().hasStructuredData()){
+                       FetchNaturalLanguageDescriptionJob job = new FetchNaturalLanguageDescriptionJob("Retrieving Natural Language Description", getEntity());
+                       job.schedule();
+               }else{
+                       label.setText("Taxon Description does not contain structured data.");
+               }
+               
+       }
 }
index bf5b1e10eb9895f0a184bd4bdb7d308455632613..299bd404c71ad4e8150b3a5369f3677cc8f860fa 100644 (file)
@@ -104,4 +104,20 @@ public abstract class AbstractDetailedDescriptionDetailElement<T extends Descrip
         }
 
     }
+    
+    @Override
+    public void fillFields() {
+       timePeriod.setEntity(getEntity().getTimeperiod());
+        if (section_modifiers != null) {
+               section_modifiers.setEntity(getEntity());
+        }
+        if (text_modifyingText!= null) {
+               if(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()) != null) {
+                text_modifyingText.setText(getEntity().getModifyingText().get(CdmStore.getDefaultLanguage()).getText());
+            }
+        }
+    }
+    
+    
+    
 }
\ No newline at end of file
index 37ab8bcbf8bba515ef6b42db7abd879d46b59c18..fc978938891bd62e7a8e872a6ecdbefc399494cf 100644 (file)
@@ -9,6 +9,8 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.section.description.ModifierSection;
 import eu.etaxonomy.taxeditor.ui.section.description.StateDataSection;
 
 /**
@@ -59,4 +61,13 @@ public class CategoricalDataDetailElement extends AbstractDetailedDescriptionDet
                        getEntity().setOrderRelevant(checkbox_orderRelevant.getSelection());
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       checkbox_orderRelevant.setEnabled(getEntity().getOrderRelevant());
+                       section_stateData.setEntity(getEntity());
+               }
+       }
 }
index 62a949ac2f2593cb00c2d65c64cda342d53d6bb7..5119ea40a0c83ddde913c235993de8205f662794 100644 (file)
@@ -96,4 +96,16 @@ public class CommonNameDetailElement extends AbstractDetailedDescriptionDetailEl
                }
        }
 
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       combo_language.setSelection(getEntity().getLanguage());
+                       selection_namedArea.setEntity(getEntity().getArea());
+                       commonName.setText(getEntity().getName());
+               }
+               
+               
+       }
+
 }
index 566d97975b77a68a3afef99c4614f2656d941cb3..7012a42621ca672b9c5fdc2372882b8e8ef51a38 100644 (file)
@@ -137,4 +137,16 @@ public class DistributionDetailElement extends
        public void setName(String nameCache){
            taxonOfDistribtion.setText(nameCache);
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       selection_namedArea.setEntity(getEntity().getArea());
+                       combo_presenceAbsence.setSelection(getEntity().getStatus());
+                       String nameCache = null;
+                       nameCache = ((IDistributionEditorPart)AbstractUtility.getActivePart()).getEditor().getActualNameCache();
+                       taxonOfDistribtion.setText(nameCache);
+               }
+       }
 }
\ No newline at end of file
index f35aab5c9f91c5fcd537048feda9505c720be214..bec4bf98495eb957523aa343eafd443f0c94529c 100644 (file)
@@ -74,4 +74,17 @@ public class IndividualsAssociationDetailElement extends
                        getEntity().putDescription(CdmStore.getDefaultLanguage(), text_description.getText());
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       if (getEntity().getDescription() != null && getEntity().getDescription().get(CdmStore.getDefaultLanguage()) != null) {
+                               text_description.setText(getEntity().getDescription().get(
+                                               CdmStore.getDefaultLanguage()).getText());
+                       }
+                       selection_derivedUnit.setEntity(getEntity().getAssociatedSpecimenOrObservation());
+               }
+               
+       }
 }
\ No newline at end of file
index a6ab7cf0e2ede6126d4da81093c4b35c624cbc33..e0fd12b6b19a1f2bc7b34d7b53b8b477a30d45a4 100644 (file)
@@ -64,4 +64,16 @@ public class QuantitativeDataDetailElement extends
                        // FIXME
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       
+                       comboMeasurementUnit.setSelection(getEntity().getUnit());
+                       section_statisticalMeasurementValues.setEntity(getEntity());
+
+               }
+               
+       }
 }
index 8ee7d4d6dac2e195d98a8f40a896db66eed4110c..47a17e1271801f0670a0504dec128daabea5deae 100644 (file)
@@ -96,4 +96,15 @@ public class TaxonInteractionDetailElement extends
                        getEntity().putDescription(CdmStore.getDefaultLanguage(), interactionDescription.getText());
                }
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       taxonSelection.setEntity(getEntity().getTaxon2());
+                       interactionDescription.setText(getEntity().getDescription(CdmStore.getDefaultLanguage()));
+
+               }
+               
+       }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 28c85f7..269abad
@@ -46,4 +46,13 @@ public class TemporalDataDetailElement extends AbstractDetailedDescriptionDetail
 
     }
 
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       timePeriod.setTimePeriod(getEntity().getPeriod());
+               }
+               
+       }
+
 }
index 8b5e3b5172857f18b53e37acbcfa018fa55200e4..65df6d439c3f9b4dafe9183e4428dda59fe081b2 100644 (file)
@@ -75,4 +75,13 @@ public class TextDataDetailElement extends AbstractDetailedDescriptionDetailElem
            }
            super.propertyChange(event);
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       super.fillFields();
+                       multilanguageTextElement.setMultilanguageText(getEntity().getMultilanguageText());
+               }
+               
+       }
 }
index 7bc31e063399c8bbf69bfe96d0696586f34039f1..c54578e78058dffc785179e218bffe30eb4ff365 100644 (file)
@@ -294,4 +294,26 @@ public class CharacterDetailElement extends AbstractCdmDetailElement<Character>
            }
        }
 
+       @Override
+       public void fillFields() {
+               if (getEntity()!= null) {
+                       element_Representation.setTerm(getEntity(), isEnabled());
+                       comboStructuralModifier.setSelection(getEntity().getStructureModifier());
+                       supportsQuantitativeData.setSelection(getEntity().isSupportsQuantitativeData());
+                       supportsCategoricalData.setSelection(getEntity().isSupportsCategoricalData());;
+                       availableForTaxon.setSelection(getEntity().isAvailableForTaxon());
+                       availableForTaxonName.setSelection(getEntity().isAvailableForTaxonName());
+                       availableForSpecimenOrObservation.setSelection(getEntity().isAvailableForOccurrence());
+                       sectionStateVocabularies.setEntity(getEntity());
+                       sectionMeasurementUnits.setEntity(getEntity());
+                       sectionStatisticalMeasures.setEntity(getEntity());
+                       sectionModifierVocabularies.setEntity(getEntity());
+                       
+                       text_structure.setText(CharacterNodeDetailElement.getStructureText(getEntity()));
+                       text_property.setText(CharacterNodeDtoDetailElement.getPropertyText(getEntity()));
+                       ratioTo.setText(CharacterNodeDetailElement.getRatioToText(getEntity()));
+               }
+               
+       }
+
 }
old mode 100755 (executable)
new mode 100644 (file)
index 83838c6..bfca2e8
@@ -330,4 +330,25 @@ public class CharacterDtoDetailElement extends AbstractCdmDetailElement<Characte
 
        }
 
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       element_Representation.setTermDto(getEntity(), true);
+                       comboStructuralModifier.setSelectionDto(getEntity().getStructureModifier());
+                       supportsQuantitativeData.setSelection(getEntity().isSupportsQuantitativeData());
+                       supportsCategoricalData.setSelection(getEntity().isSupportsCategoricalData());
+                       availableForTaxon.setSelection(getEntity().isAvailableForTaxon());
+                       availableForTaxonName.setSelection(getEntity().isAvailableForTaxonName());
+                       availableForSpecimenOrObservation.setSelection(getEntity().isAvailableForOccurrence());
+                       sectionStateVocabularies.setEntity(getEntity());
+                       sectionMeasurementUnits.setEntity(getEntity());
+                       sectionStatisticalMeasures.setEntity(getEntity());
+                       sectionModifierVocabularies.setEntity(getEntity());
+                       text_structure.setText(getEntity().getStructure().getPath());
+                       text_property.setText(getEntity().getProperty().getPath());
+                       ratioTo.setText(getEntity().getRatioTo() != null? getEntity().getRatioTo().getPath():null);
+               }
+               
+       }
+
 }
index 9e74a4e849c621a75cbd0f4f5752745d064ebd22..e49d37c9e0555e89f3d854f62cc513217e86fc63 100644 (file)
@@ -27,23 +27,6 @@ public class CharacterNodeDetailElement extends AbstractCdmDetailElement<TermNod
     private CharacterDetailSection characterDetails;
 
     private ICdmFormElement parentFormElement;
-//
-//    protected RepresentationElement element_Representation;
-//
-//    private TermComboElement<DefinedTerm> comboStructuralModifier;
-//
-//    private CheckboxElement supportsQuantitativeData;
-//
-//    private CheckboxElement supportsCategoricalData;
-//
-//    private StateVocabularyCollectionSection sectionStateVocabularies;
-//
-//    private MeasurementUnitCollectionSection sectionMeasurementUnits;
-//
-//    private StatisticalMeasureCollectionSection sectionStatisticalMeasures;
-//
-//    private RecommendedModifierVocabulariesCollectionSection sectionModifierVocabularies;
-
     private InapplicableIfEntityCollectionSectionForNode sectionInapplicableIf;
     private OnlyApplicableIfEntityCollectionSectionForNode sectionOnlyApplicableIf;
 
@@ -61,40 +44,6 @@ public class CharacterNodeDetailElement extends AbstractCdmDetailElement<TermNod
            addElement(characterDetails);
            addControl(characterDetails);
            characterDetails.setEntity(entity.getTerm());
-//         element_Representation = formFactory.createTranslatableRepresentationElement(formElement,  entity.getTerm().getPreferredRepresentation(CdmStore.getDefaultLanguage()),entity.getTerm(), 100, style, true);
-//
-//         createText(formElement, "Structure", getStructureText(entity.getTerm()));
-//         createText(formElement, "Property", getPropertyText(entity.getTerm()));
-//
-//        comboStructuralModifier = formFactory.createDefinedTermComboElement(TermType.StructureModifier, formElement, "Structural Modifier", entity.getTerm().getStructureModifier(), style);
-//
-//         supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitative Data", entity.getTerm().isSupportsQuantitativeData(), style);
-//         supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", entity.getTerm().isSupportsCategoricalData(), style);
-//
-//        if (supportsCategoricalData.getSelection()) {
-//            sectionStateVocabularies = formFactory.createStateVocabulariesSection(
-//                    parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionStateVocabularies.setEntity(entity.getTerm());
-//        }
-//        if (supportsQuantitativeData.getSelection()) {
-//            sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(
-//                    parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionMeasurementUnits.setEntity(entity.getTerm());
-//
-//            sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(
-//                    parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionStatisticalMeasures.setEntity(entity.getTerm());
-//        }
-//        if (supportsCategoricalData.getSelection() || supportsQuantitativeData.getSelection()) {
-//            sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                    parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, entity.getClass().getCanonicalName(), true));
-//            sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//            sectionModifierVocabularies.setEntity(entity.getTerm());
-//        }
-
         // applicability
         sectionInapplicableIf = formFactory.createInapplicableIfEntityCollectionSectionForNode(
                 formElement, StoreUtil.getSectionStyle(InapplicableIfEntityCollectionSection.class, entity.getTerm().getClass().getCanonicalName()));
@@ -128,104 +77,14 @@ public class CharacterNodeDetailElement extends AbstractCdmDetailElement<TermNod
        @Override
        public void handleEvent(Object eventSource) {
 
-//         if(eventSource == characterDetails){
-//             getEntity().getTerm().setStructureModifier(comboStructuralModifier.getSelection());
-//         }
-//         if(eventSource == supportsQuantitativeData || eventSource == supportsCategoricalData){
-//             //if any type is selected disable supportsTextData
-//             getEntity().getTerm().setSupportsTextData(false);
-//         }
-//         if(eventSource == supportsQuantitativeData){
-//             getEntity().getTerm().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());
-//             if(supportsQuantitativeData.getSelection()){
-//                 activateQuantitativeWidgets();
-//             }
-//             else{
-//                 removeQuantitativeWidgets();
-//             }
-//            StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-//         }
-//         else if(eventSource == supportsCategoricalData){
-//             getEntity().getTerm().setSupportsCategoricalData(supportsCategoricalData.getSelection());
-//            if (supportsCategoricalData.getSelection()) {
-//                activateCategoricalWidgets();
-//            }
-//             else{
-//                 removeCategoricalWidgets();
-//             }
-//            StoreUtil.reflowParentScrolledForm(getLayoutComposite(), true);
-//         }
-//         else if (eventSource == element_Representation) {
-//            Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
-//            if(selectedRepresentation!=null){
-//                Language representationLanguage = selectedRepresentation.getLanguage();
-//                if(representationLanguage==null){
-//                    representationLanguage = Language.getDefaultLanguage();
-//                }
-//                getEntity().getTerm().setLabel(selectedRepresentation.getLabel(),  representationLanguage);
-//                getEntity().getTerm().getRepresentation(representationLanguage).setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
-//                getEntity().getTerm().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
-//            }
-//            getEntity().getTerm().setTitleCache(null);
-//        }
+
        }
 
-//     private void activateQuantitativeWidgets(){
-//         //disable categorical widgets
-//         supportsCategoricalData.setSelection(false);
-//         getEntity().getTerm().setSupportsCategoricalData(false);
-//         removeCategoricalWidgets();
-//
-//         //measurement units
-//         sectionMeasurementUnits = formFactory.createMeasurementUnitCollectionSection(getConversationHolder(),
-//                 parentFormElement, StoreUtil.getSectionStyle(MeasurementUnitCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//         sectionMeasurementUnits.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//         sectionMeasurementUnits.setEntity(getEntity().getTerm());
-//
-//         //statistical measures
-//         sectionStatisticalMeasures = formFactory.createStatisticalMeasureCollectionSection(
-//                 parentFormElement, StoreUtil.getSectionStyle(StatisticalMeasureCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//         sectionStatisticalMeasures.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//         sectionStatisticalMeasures.setEntity(getEntity().getTerm());
-//
-//         //modifiers
-//         sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                 parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//         sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//         sectionModifierVocabularies.setEntity(getEntity().getTerm());
-//     }
-//
-//     private void removeQuantitativeWidgets(){
-//         if(sectionMeasurementUnits!=null){
-//             removeElementsAndControls(sectionMeasurementUnits);
-//             removeElementsAndControls(sectionStatisticalMeasures);
-//             removeElementsAndControls(sectionModifierVocabularies);
-//         }
-//     }
-//
-//     private void activateCategoricalWidgets(){
-//         //disable quantitative widgeets
-//         supportsQuantitativeData.setSelection(false);
-//         getEntity().getTerm().setSupportsQuantitativeData(false);
-//         removeQuantitativeWidgets();
-//
-//         //states
-//         sectionStateVocabularies = formFactory.createStateVocabulariesSection(getConversationHolder(),
-//                parentFormElement, StoreUtil.getSectionStyle(StateVocabularyCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//        sectionStateVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//        sectionStateVocabularies.setEntity(getEntity().getTerm());
-//
-//        //modifiers
-//        sectionModifierVocabularies = formFactory.createRecommendedModifierVocabulariesCollectionSection(
-//                parentFormElement, StoreUtil.getSectionStyle(RecommendedModifierVocabulariesCollectionSection.class, getEntity().getClass().getCanonicalName(), true));
-//        sectionModifierVocabularies.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
-//        sectionModifierVocabularies.setEntity(getEntity().getTerm());
-//     }
-//
-//     private void removeCategoricalWidgets(){
-//         if(sectionStateVocabularies!=null){
-//             removeElementsAndControls(sectionStateVocabularies);
-//             removeElementsAndControls(sectionModifierVocabularies);
-//         }
-//     }
+       @Override
+       public void fillFields() {
+               characterDetails.setEntity(getEntity().getTerm());
+               sectionInapplicableIf.setEntity(getEntity());
+           sectionOnlyApplicableIf.setEntity(getEntity());
+               
+       }
 }
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index aaebe42..0f8de04
@@ -131,6 +131,14 @@ public class CharacterNodeDtoDetailElement extends AbstractCdmDetailElement<Term
 //        }
        }
 
+       @Override
+       public void fillFields() {
+               characterDetails.setEntity((CharacterDto)getEntity().getTerm());
+               sectionInapplicableIf.setEntity(getEntity());
+               sectionOnlyApplicableIf.setEntity(getEntity());
+               
+       }
+
 //     private void activateQuantitativeWidgets(){
 //         //disable categorical widgets
 //         supportsCategoricalData.setSelection(false);
index 131689f6bbfa2dea0371701324423b4a017cd46a..26f4b62d6372e8d2f24875caf968cce9b3c6ce89 100644 (file)
@@ -127,4 +127,31 @@ public class FeatureDistributionDetailElement extends AbstractCdmDetailElement<F
            return false;
        }
 
+       @Override
+       public void fillFields() {
+               String serviceUriString = PreferencesUtil.getStringValue(PreferencePredicate.EditMapServiceAccessPoint.getKey());
+               String message = null;
+               try {
+                       URI serviceUri = new URI(serviceUriString);
+                       if(UriUtils.isServiceAvailable(serviceUri, 500)){
+//                             image = formFactory.createBrowserElement(formElement, null, style);
+                               // FIXME : This is a temporary workaround which ic
+                               //         waiting for #5357 to be fixed
+                               if(!isUnsavedDistribution(getEntity())) {
+                                   String mapUriString = getMapUriString(getEntity());
+                                   image.setImageUriString(mapUriString);
+                                   message = mapUriString;
+                               }
+                               getParentElement().getLayoutComposite().layout();
+
+                               return;
+                       } else {
+                               message = String.format("The service is not available: %s", serviceUriString);
+                       }
+               } catch (URISyntaxException e) {
+                       message = String.format("The URI has problems: %s", serviceUriString);
+               }
+               
+       }
+
 }
index 15ed9784341c6f3e28bfe1d00acde3b831bd796b..d92b4ad1a3687609924635caee03d54e72ee8f0d 100644 (file)
@@ -62,6 +62,13 @@ public class TermNodeDetailElement extends AbstractCdmDetailElement<TermNodeDto>
            EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity().getUuid());
        }
 
+       @Override
+       public void fillFields() {
+               sectionInapplicableIf.setEntity(getEntity());
+           sectionOnlyApplicableIf.setEntity(getEntity());
+               
+       }
+
 
 
 }
index eac9ab0a1d35076b9537c4eead69548864cf700e..3030dcfec709ba165d2da0df71592c090270eed8 100644 (file)
@@ -106,4 +106,14 @@ public class TermTreeDetailElement extends AbstractCdmDetailElement<TermTreeDto>
            }
            EventUtility.postEvent(WorkbenchEventConstants.ADD_SAVE_CANDIDATE, getEntity());
        }
+
+       @Override
+       public void fillFields() {
+
+           allowDuplicates.setSelection(getEntity().isAllowDuplicate());
+           orderRelevant.setSelection(getEntity().isOrderRelevant());
+           isFlat.setSelection(getEntity().isFlat());
+           element_Representation.setTermDto(getEntity(), enabled);
+               
+       }
 }
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index a83c0b1..526f9bd
@@ -102,4 +102,13 @@ public class TermTreeDetailElementForNode extends AbstractCdmDetailElement<TermT
            }
        }
 
+
+       @Override
+       public void fillFields() {
+                allowDuplicates.setSelection(getEntity().isAllowDuplicates());
+                orderRelevant.setSelection(getEntity().isOrderRelevant());
+                isFlat.setSelection(getEntity().isFlat());
+               
+       }
+
 }
index a75270ef3efa602f93295ccfa57215f6073aff45..3d7f3029bb6d39a9b4f1177a124baa8345209417 100644 (file)
@@ -54,6 +54,12 @@ public class GrantedAuthorityDetailElement extends AbstractCdmDetailElement<Gran
 
        }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 
 
 }
index 0530f7ca999b3912a8ce9901f760f62e8d72a7a3..9a61da360a10e88030ac07e4aa2571dfae3afbb0 100644 (file)
@@ -52,4 +52,10 @@ public class GroupDetailElement extends AbstractCdmDetailElement<Group> {
                }
        }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 7c6b78a215b1fa7ac4fdda37f66c3734d49465ab..c6163b68c535f1361b1e1f9eb95e0f0102d2ef6c 100644 (file)
@@ -67,4 +67,10 @@ public class PolytomousKeyDetailElement extends
                }
                firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 0e5e547bdd9f89013cf7c569918ea5ddf7e68bde..daa95df0124b098025891d50fc18a97174c2c6d7 100644 (file)
@@ -112,4 +112,10 @@ public class PolytomousKeyNodeDetailElement extends
                        getEntity().setOtherNode(selection_otherNode.getEntity());
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 0a1099ab3497d8178d012bad4e422b052fe485e2..29c38d830299c09345490efba06928f914c5a776 100644 (file)
@@ -312,4 +312,10 @@ public class MediaDetailElement extends AbstractCdmDetailElement<Media>{
         return uriBuffer;
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 82f44cd4390913a71cb94f3dc71a280d9c108a06..668f9006fb7365c9cde995cc306433550266c8fe 100644 (file)
@@ -173,4 +173,26 @@ public class AuthorshipDetailElement
                }
            }
        }
+
+       @Override
+       public void fillFields() {
+               /*
+               toggleable_cache.setText(getEntity().getAuthorshipCache());
+               toggleable_cache.setSelected(getEntity().isProtectedAuthorshipCache());
+               selectionExBasionymAuthor.setEntity(getEntity().getExBasionymAuthorship());
+           selectionBasionymAuthor.setEntity(getEntity().getBasionymAuthorship());
+           selectionExCombinationAuthor.setEntity(getEntity().getExCombinationAuthorship());
+           selectionCombinationAuthor.setEntity(getEntity().getCombinationAuthorship());
+           if (text_originalPublicationYear != null) {
+               
+           }
+           if (text_publicationYear != null) {
+               text_publicationYear.setNumber(((IZoologicalName)getEntity()).getPublicationYear());
+               text_originalPublicationYear.setNumber(((IZoologicalName)getEntity()).getOriginalPublicationYear());
+           }
+           
+           */
+
+               
+       }
 }
\ No newline at end of file
index 6a407358a9769ba96540c87d83e8ddcbeef8f4ce..9b07c1243b7e56600cf2c6cfa7b2e935a4d1a70b 100644 (file)
@@ -39,6 +39,12 @@ public class AuthorshipDetailSection extends AbstractCdmDetailSection<INonViralN
                INonViralName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               INonViralName name = HibernateProxyHelper.deproxy(entity.getName());
+               setEntityWithoutUpdate(name);
+       }
 
        @Override
        public String getHeading() {
index a780e860d1aa58470f320bb5a0d5d45e95a2d238..b83f02d4193f2cf7d19fc7d11005e2c148756f09 100644 (file)
@@ -90,4 +90,13 @@ public class HybridDetailElement extends AbstractCdmDetailElement<INonViralName>
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               checkboxMonomHybrid.setSelection(getEntity().isMonomHybrid());
+               checkboxBinomHybrid.setSelection(getEntity().isBinomHybrid());
+               checkboxTrinomHybrid.setSelection(getEntity().isTrinomHybrid());
+               checkboxHybridFormula.setSelection(getEntity().isHybridFormula());
+               
+       }
 }
\ No newline at end of file
index e463f542cc8226dab708f140050b29b66c76c248..835c4825cde66b4427dfa905049c77c7191cdfca 100644 (file)
@@ -41,6 +41,12 @@ public class HybridDetailSection
                TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
                setEntity(name);
        }
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase taxon) {
+               taxonBase = taxon;
+               TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setEntityWithoutUpdate(name);
+       }
 
        @Override
        public TaxonBase getTaxonBase() {
index b855e5618798175b1aadda399f6bb922c1e9376d..47bc29357c4d9286afa7e684f241d8162cd016a7 100644 (file)
@@ -377,4 +377,45 @@ public class NameDetailElement
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               if (combo_rank != null && (combo_rank.getSelection() == null || !combo_rank.getSelection().equals(getEntity().getRank()))  ) {
+                       combo_rank.setSelection(getEntity().getRank());
+               }
+               if(text_appendedPhrase != null && (text_appendedPhrase.getText() == null || !text_appendedPhrase.getText().equals(getEntity().getAppendedPhrase()))) {
+                       text_appendedPhrase.setText(getEntity().getAppendedPhrase());
+               }
+               if (text_uninomial != null && (text_uninomial.getText() == null || !text_uninomial.getText().equals(getEntity().getGenusOrUninomial()))) {
+                       text_uninomial.setText(getEntity().getGenusOrUninomial());
+               }
+               if (text_infragenericEpithet != null && (text_infragenericEpithet.getText() == null || !text_infragenericEpithet.getText().equals(getEntity().getInfraGenericEpithet()))) {
+                       text_infragenericEpithet.setText(getEntity().getInfraGenericEpithet());
+               }
+               if (text_specificEpithet != null && (text_specificEpithet.getText() == null || !text_specificEpithet.getText().equals(getEntity().getSpecificEpithet()))) {
+                       text_specificEpithet.setText(getEntity().getSpecificEpithet());
+               }
+               if (text_infraspecificEpithet != null && getEntity().getInfraSpecificEpithet() != null && !text_infraspecificEpithet.getText().equals(getEntity().getInfraSpecificEpithet())) {
+                       text_infraspecificEpithet.setText(getEntity().getInfraSpecificEpithet());
+               }
+               if (checkbox_anamorphic != null && (checkbox_anamorphic.getSelection() != ((IFungusName)getEntity()).isAnamorphic())) {
+                       checkbox_anamorphic.setSelection(((IFungusName)getEntity()).isAnamorphic());
+               }
+               if (text_cultivarName != null && ((ICultivarPlantName)getEntity()).getCultivarEpithet() != null && !text_cultivarName.getText().equals(((ICultivarPlantName)getEntity()).getCultivarEpithet())) {
+                       text_cultivarName.setText(((ICultivarPlantName)getEntity()).getCultivarEpithet());
+               }
+               if (text_cultivarGroup != null && ((ICultivarPlantName)getEntity()).getCultivarGroupEpithet() != null && !text_cultivarGroup.getText().equals(((ICultivarPlantName)getEntity()).getCultivarGroupEpithet())) {
+                       text_cultivarGroup.setText(((ICultivarPlantName)getEntity()).getCultivarGroupEpithet());
+               }
+               if (text_subGenusAuthorship != null && ((IBacterialName)getEntity()).getSubGenusAuthorship() != null && !text_subGenusAuthorship.getText().equals(((IBacterialName)getEntity()).getSubGenusAuthorship())) {
+                       text_subGenusAuthorship.setText(((IBacterialName)getEntity()).getSubGenusAuthorship());
+               }
+               if (text_breed!= null && ((IZoologicalName)getEntity()).getBreed() != null && !text_breed.getText().equals(((IZoologicalName)getEntity()).getBreed())) {
+                       text_breed.setText(((IZoologicalName)getEntity()).getBreed());
+               }
+               ((NameDetailSection)this.getParentElement()).setSectionTitle();
+               
+               
+       }
 }
\ No newline at end of file
index 9e029a50a7e5ea89220bf8e055b7299035a2b21e..66d436bd5f76c62652c6c98ced6a788808c282a5 100644 (file)
@@ -72,4 +72,14 @@ public class NameDetailSection
        public void updateContent(){
                ((NameDetailElement)this.detailElement).updateContent();
        }
+
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
+               this.taxonBase = taxon;
+               INonViralName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setEntityWithoutUpdate(name);
+               
+       }
+
+       
 }
index db3db4858860164fbe3a3ebfc8039e57a76481c1..51ac303155789390cdaed7f1441c806ee8678dbc 100644 (file)
@@ -91,7 +91,13 @@ public class NameRelationshipDetailSection extends AbstractEntityCollectionSecti
                TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
-
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
+               setEntity(name);
+       }
+       
        @Override
        public TaxonBase getTaxonBase() {
                return taxonBase;
index 0a74474ec38e793a8242d2cdeca9ec479ff8289d..e0dd9b5c70b71003366d212fecb8f768e33248c6 100644 (file)
@@ -76,6 +76,13 @@ public class NomenclaturalStatusSection
                TaxonName nonViralName = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(nonViralName);
        }
+       
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               TaxonName nonViralName = HibernateProxyHelper.deproxy(entity.getName());
+               this.setEntity(nonViralName);
+       }
 
        @Override
        public TaxonBase getTaxonBase() {
index 72d6eef38391ce9a105753665cf9a7bd5c236ec5..6abaed300231a3eedfab0f565266c1045da54c0f 100644 (file)
@@ -252,4 +252,19 @@ public class NonViralNameDetailElement
         updateCacheRelevance();
         updateToggleableCacheField();
     }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               
+               section_name.getDetailElement().fillFields();;
+               section_author.getDetailElement().fillFields();
+               combo_nomenclaturalCode.setSelection(getEntity().getNameType());
+               section_hybrid.getDetailElement().fillFields();
+               textLsid.setText(getEntity().getLsid()!= null? getEntity().getLsid().toString():null);
+               if (text_nameApprobation != null) {
+                       text_nameApprobation.setText(getEntity().getNameApprobation());
+               }
+               
+       }
 }
\ No newline at end of file
index 94b560c6e69f1a3f19158a674c6cdd92edcdc607..28b2c3f60f5c8453c0a6fe4e6c7d1725a8ea1932 100644 (file)
@@ -135,4 +135,12 @@ public class NonViralNameDetailSection extends AbstractCdmDetailSection<TaxonNam
                        AbstractCdmDetailSection<TaxonName> parentElement, int style) {
            return formFactory.createNonViralNameDetailElement(parentElement);
        }
+
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
+               taxonBase = taxon;
+               TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
+               setEntityWithoutUpdate(name);
+               
+       }
 }
index 1ca3f689832928e7310f3337d81621ba187d6a35..a46faa33601969fba49d7471b81e646ed485011a 100644 (file)
@@ -217,6 +217,11 @@ public class TypeDesignationSection extends AbstractEntityCollectionSection<Taxo
                TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
+       
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.setTaxonBase(entity);
+       }
 
        private boolean isSpecimenType(){
                Rank rank = getEntity() == null ? null : getEntity().getRank();
index c2e5537079462681ed85664fe9995d9de75d5352..d9a7bb48e3b13f7beee1e022b0db6b82ff336766 100644 (file)
@@ -97,4 +97,10 @@ public class CollectionDetailElement extends
                    text_titleCache.setText(getEntity().getTitleCache());
         }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO actually this is only used for taxa/names
+               
+       }
 }
\ No newline at end of file
index f5665bdb61f8befac78b2accbea819533c5008fb..7485dcaf633bd2edd3fe56fc34c4b73d5c02f204 100644 (file)
@@ -148,4 +148,10 @@ public class DerivedUnitBaseDetailElement extends
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 582b5d9e1f0739025767b3e282e85dcce931398f..44227210e20c99441b62f86347ffbe094f481369 100644 (file)
@@ -132,7 +132,7 @@ public class DerivedUnitGeneralDetailElement extends
                section_status.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
                section_status.setEntity(entity);
 
-               checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.innerDerivedUnit().isPublish(), style);
+               checkIsPublish = formFactory.createCheckbox(formElement, "Publish", entity.baseUnit().isPublish(), style);
 
        }
 
@@ -194,4 +194,10 @@ public class DerivedUnitGeneralDetailElement extends
         this.showSpecimenType = showSpecimenType;
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index e3013d143fa918cfe0dd2a439e7361cb729a54df..f76a2fe96c988d69aca16cd88b690bfcd9715185 100644 (file)
@@ -51,4 +51,10 @@ public class DeterminationDetailElement extends AbstractCdmDetailElement<Specime
                        section_determinationHistory.refresh();
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 18008ee70c9f8877effaf8b2fc0ddf7972ff510d..648d1caa6f90f75bcbb202b294cc92d56d6fac96 100644 (file)
@@ -95,4 +95,10 @@ public class FieldUnitFacadeDetailElement extends AbstractSpecimenOrObservationD
                }
 
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 3778dfc01ac44b228a26e03f8b21fc855d2f31dc..f99ae927883bdc71ad1017cbb359f3e21c6de097 100644 (file)
@@ -167,4 +167,10 @@ public class FieldUnitFacadeGeneralDetailElement extends AbstractCdmDetailElemen
 
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
\ No newline at end of file
index 4bb71c9ea7df55704929fcaf3709d3a0f987179e..a5b1164fd2201518144dd3b81813108036b12191 100644 (file)
@@ -95,4 +95,10 @@ public class GatheringEventDetailElement extends
                                        text_gatheringEventDescription.getText());
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index f2404e55e73969adf269010b08509caf4ff7005f..c2fc13272b15c81d24daca6c3155a44a602a7955 100644 (file)
@@ -182,4 +182,10 @@ public class TaxonAssociationDetailElement extends AbstractCdmDetailElement<Deri
             new CdmViewerChooser(event.getViewer().getControl().getShell()).chooseViewer(firstElement);
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 204631332f9d6d08991b68c85317e1a02f7db392..41c43400fbdc8e7833b0a3e54e1b3a766d0db5a0 100644 (file)
@@ -104,4 +104,10 @@ public class PreservedSpecimenDetailElement extends
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 198a66c2815f3d608016b88cbb331a5d6f75cd61..09255116101f14b96d4d02c68b2700d1907ba3cb 100644 (file)
@@ -67,4 +67,10 @@ public class PreservedSpecimenGeneralDetailElement extends AbstractCdmDetailElem
             toggleableText_titleCache.setText(getEntity().getTitleCache());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 5f1ce1141a18c57cd7207f948aa0afef68bcb263..cc30b95df7ec28d88afd6c4f09f0c94a62d90dc8 100644 (file)
@@ -68,4 +68,10 @@ public class AmplificationCloningDetailElement extends AbstractCdmDetailElement<
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 2dccd4d6697ced9ae079f3442e1a7f729491c338..de54ed954904d893e9bf1e77dd4c2dc7121a8a3f 100644 (file)
@@ -36,4 +36,10 @@ public class AmplificationGelPhotoDetailElement  extends AbstractCdmDetailElemen
     @Override
     public void handleEvent(Object eventSource) {
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 74a92de4d4b2edf61cf9b65273819ced435ea456..e8364c3e27f792df4ad42a0032e0d2986791c0fa 100644 (file)
@@ -91,4 +91,10 @@ public class AmplificationGeneralDetailElement extends AbstractCdmDetailElement<
         getEntity().updateCache();
         textDesignation.setText(getEntity().getLabelCache());
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 81f94a546a8b6f65b9d917cd47bd2f7fe25ede4d..60c0501863c59258634bfe1b422184e9f4921243 100644 (file)
@@ -67,4 +67,10 @@ public class AmplificationPrimerDetailElement extends AbstractCdmDetailElement<A
             getEntity().setReversePrimer(selectionPrimerReverse.getSelection());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index 8b1fa716113faf9c8bb11d57ab57f1d9969805ad..15f414bf92dd742c8ac016d5a96710a1e79b6f62 100644 (file)
@@ -84,4 +84,10 @@ public class DnaQualityDetailElement extends AbstractCdmDetailElement<DnaSample>
             dnaQuality.setQualityCheckDate(dateTime);
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 6dc5c925f698acc36b6521a5232b0710da2d5a31..ba8fa81562efe657e65670bb5346362256b95e31 100644 (file)
@@ -63,4 +63,10 @@ public class DnaSampleGeneralDetailElement extends AbstractCdmDetailElement<DnaS
             getEntity().setCollection(selection_collection.getSelection());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 30780521ca0fa4039bfe6d53968c80c9e7cce6bb..e4b7bad2a55c108a7be840e235f116c6985acea1 100644 (file)
@@ -102,4 +102,10 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         }
         return preservationMethod;
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index e7a0c9692cfde1d719fa3a416d62cdd310815ada..31f23f3a776fc7e9a43c1d2246507c7a28d4e883 100644 (file)
@@ -84,4 +84,10 @@ public class PrimerGeneralDetailElement extends AbstractCdmDetailElement<Primer>
             getEntity().setPublishedIn(selectionReference.getSelection());
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index a2541675e531f5e5561558146b05b4d55f391026..2517f16f016c0fa62072071d2233f96bedd06319 100644 (file)
@@ -50,4 +50,10 @@ public class SampleDesignationDetailElement
                        sectionSampleDesignationHistory.refresh();
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 4403aa6c748e4e2183cf8a5bd5b6cdb34e1d8207..1fb93a059d3fe3b4ed4debb152f3c4cbbe3b79df 100644 (file)
@@ -140,4 +140,10 @@ public class SequenceGeneralDetailElement extends AbstractCdmDetailElement<Seque
         }
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
index 08af700da2bf2b90e86ade7c5fc8ffcd34b67a44..1cac012a9fc5301e3dfff2822aca2aed0a1fa82f 100644 (file)
@@ -74,4 +74,10 @@ public class SingleReadGeneralDetailElement extends AbstractCdmDetailElement<Sin
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
index b1dd94ed7baa45774606d4af4dcb0b1884d79f18..43d797dfe996881ca642a2eb5732d86ae58a837e 100644 (file)
@@ -136,4 +136,20 @@ public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<D
         }
         return preservationMethod;
     }
+    
+    @Override
+    public void fillFields() {
+       
+       //TODO: implement 
+//     comboKindOfTissue;
+//        selectionInstitution;
+//        selectionStaff;
+//        datePreparation;
+//        comboPreservationMedium;
+//        selectionCollection;
+//        textAccessionNumber;
+//        textBarcode;
+//        checkIsPublish;
+
+    }
 }
\ No newline at end of file
index 4c16d4875fc18d94caafdb589c5b72f848ffcfb2..abe1cbf8b244386123ef8797636b61c0f67067b6 100644 (file)
@@ -216,4 +216,10 @@ public class MediaSpecimenGeneralDetailElement
         return mediaDetailElement.isAdvancedMediaView();
     }
 
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
+
 }
old mode 100755 (executable)
new mode 100644 (file)
index 0fbf232..014bf9e
@@ -82,4 +82,15 @@ public class AdvancedSourceElement extends AbstractCdmDetailElement<OriginalSour
              ((NamedSourceBase)getEntity()).setNameUsedInSource(select_nameUsedInSource.getEntity());
          }
     }
+
+       @Override
+       public void fillFields() {
+               if (this.getEntity() != null) {
+                       text_idInSource.setText(this.getEntity().getIdInSource());
+                   text_idNamespace.setText(this.getEntity().getIdNamespace());;
+                   text_originalInfo.setText(this.getEntity().getOriginalInfo());                  
+                   select_nameUsedInSource.setEntity(((NamedSourceBase)getEntity()).getNameUsedInSource());;
+               }
+               
+       }
 }
\ No newline at end of file
index 7ce690091ee98e5286e511b94467936453dfb8c2..e122a269639090abd1d06f748b9046c251282d00 100644 (file)
@@ -65,7 +65,15 @@ public class NomenclaturalSourceDetailElement extends
 
        @Override
        public void handleEvent(Object eventSource) {
+               if (eventSource.equals(sourceElement)) {
+                       getEntity().setNomenclaturalSource((NomenclaturalSource) sourceElement.getEntity());
+               }
+       }
 
+       @Override
+       public void fillFields() {
+               sourceElement.setEntity(getEntity().getNomenclaturalSource());
+               
        }
 
 
index 86b68c64c4a8bbd1772bd658445ef9e40806a49b..add2f8bb62f97eb5c3f7b5b983073f8a2e1ed5e6 100644 (file)
@@ -56,6 +56,12 @@ public class NomenclaturalSourceDetailSection extends
                TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
                setEntity(name);
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               this.taxonBase = entity;
+               TaxonName name = HibernateProxyHelper.deproxy(entity.getName());
+               setEntityWithoutUpdate(name);
+       }
 
        @Override
        protected void setSectionTitle() {
old mode 100755 (executable)
new mode 100644 (file)
index 4b64c75..633e7b0
@@ -152,6 +152,24 @@ public class OriginalSourceElement<T extends OriginalSourceBase>
                updateContent();
                this.getParentElement().refresh();
        }
+
+       @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       selection_Ref.setEntity(getEntity().getCitation()!= null? getEntity().getCitation(): null);
+                   microReference.setText(getEntity().getCitationMicroReference());
+                   if (accessed != null) {
+                       accessed.setEntity(getEntity().getAccessed()!= null? getEntity().getAccessed(): null);
+                   }
+                   if (advancedSection != null) {
+                       advancedSection.setEntity(getEntity());
+                   }
+                       
+                   externalLinks.setEntity(getEntity());
+                   
+               }
+               
+       }
     
 
     
index cfa5dcb4ff0b9fc09d8316d06c185b472c35af58..57f881dd830d4527512236689e9fd67bf1005412 100644 (file)
@@ -579,4 +579,10 @@ public class ReferenceDetailElement extends AbstractIdentifiableEntityDetailElem
 
            updateCacheRelevance();
        }
+
+       @Override
+       public void fillFields() {
+               // TODO Auto-generated method stub
+               
+       }
 }
\ No newline at end of file
index 9c25c3c104a46d4909a0811563cc6cc7464e3b31..c8aa6aeac5fca92d733227e4c6f101e92c79dac0 100644 (file)
@@ -43,6 +43,14 @@ public class ReferenceDetailSection extends AbstractCdmDetailSection<Reference>
 
                setEntity(reference);
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase<?> entity) {
+               this.taxonBase = entity;
+               TaxonName name = entity.getName();
+               Reference reference = HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
+
+               setEntityWithoutUpdate(reference);
+       }
 
        @Override
        public String getHeading() {
index 0265ede1600565b43817113943d5c232780041f9..a16c831026b53fbb4c873ca8e86121659baf31f6 100644 (file)
@@ -36,4 +36,10 @@ public class SecundumSourceDetailElement extends AbstractCdmDetailElement<TaxonB
                
        }
 
+       @Override
+       public void fillFields() {
+               sourceElement.fillFields();
+               
+       }
+
 }
old mode 100755 (executable)
new mode 100644 (file)
index f977792..f580efb
@@ -35,7 +35,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 public class SecundumSourceElement extends OriginalSourceElement<SecundumSource> {
 
        protected EntitySelectionElement<TaxonName> select_nameUsedInSource;
-
+       
        public SecundumSourceElement(CdmFormFactory formFactory, ICdmFormElement formElement, CdmBase cdmEntity,
             String label) {
         super(formFactory, formElement, cdmEntity, label);
@@ -44,7 +44,7 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
     @Override
     protected void createControls(ICdmFormElement formElement, SecundumSource entity,  int style) {
 
-        setEntityWithoutUpdate(HibernateProxyHelper.deproxy(entity));
+        HibernateProxyHelper.deproxy(entity);
 
         this.selection_Ref = formFactory.createSelectionElement(Reference.class, formElement, "Secundum", getEntity()!= null? getEntity().getCitation(): null, EntitySelectionElement.ALL, style);
         if (entity.getCitation() != null) {
@@ -88,4 +88,15 @@ public class SecundumSourceElement extends OriginalSourceElement<SecundumSource>
                super.handleEvent(eventSource);
         }
     }
+    
+    @Override
+       public void fillFields() {
+               if (getEntity() != null) {
+                       super.fillFields();
+                       if (select_nameUsedInSource != null) {
+                               select_nameUsedInSource.setEntity(getEntity().getNameUsedInSource());
+                       }
+               }
+               
+       }
 }
\ No newline at end of file
index 9e0e8e9028d0c62426444f44dda0768523c2190d..0e9663be6eca75574113fd02262852227464329c 100644 (file)
@@ -56,6 +56,12 @@ public class ParsingMessagesSection
                        displayParsingProblems();
                }
        }
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase entity) {
+               //
+               this.taxonBase = entity;
+               this.setEntityWithoutUpdate(entity.getName());
+       }
 
        private void destroyParsingProblemComposites() {
                setText(HEADING_SUCCESS);
index 6d03fc790af215ba20f330c33cc165979b801b6b..adb6955ed41d685e809bcf29efa7e9d6e4159dda 100644 (file)
@@ -158,4 +158,27 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                updateContent();
 
        }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               if (!(checkbox_doubtful.getSelection() == getEntity().isDoubtful())) {
+                       checkbox_doubtful.setSelection(getEntity().isDoubtful());
+               }               
+               if (!(checkbox_useNameCache.getSelection() == getEntity().isUseNameCache())) {
+                       checkbox_useNameCache.setSelection(getEntity().isUseNameCache());
+               }
+               if (!secElement.getEntity().equals(getEntity().getSecSource())) {
+                       secElement.fillFields();
+               }
+               if (getEntity().getAppendedPhrase()!= null && !getEntity().getAppendedPhrase().equals(text_appendedPhrase.getText())) {
+                       text_appendedPhrase.setText(getEntity().getAppendedPhrase());
+               }
+               if (!(checkbox_published.getSelection() == getEntity().isPublish())) {
+                       checkbox_published.setSelection(getEntity().isPublish());
+               }
+               if (combo_relationshipType != null && !((Synonym) getEntity()).getType().equals(combo_relationshipType.getSelection())) {
+                       combo_relationshipType.setSelection(((Synonym) getEntity()).getType());
+               }               
+       }
 }
\ No newline at end of file
index ed57e96068684308d844837c9bc888f916e600c8..7cc23688186059a97b624012be0cb798584cbfad 100644 (file)
@@ -15,12 +15,13 @@ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
 
 /**
  * @author n.hoffmann
  * @created Nov 4, 2009
  */
-public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?>> {
+public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?>> implements ITaxonBaseDetailSection{
 
        public TaxonBaseDetailSection(CdmFormFactory cdmFormFactory, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style) {
                super(cdmFormFactory, parentElement, selectionProvider, style);
@@ -35,4 +36,22 @@ public class TaxonBaseDetailSection extends AbstractCdmDetailSection<TaxonBase<?
        protected AbstractCdmDetailElement<TaxonBase<?>> createCdmDetailElement(AbstractCdmDetailSection<TaxonBase<?>> parentElement, int style) {
            return formFactory.createTaxonBaseDetailElement(parentElement, style);
        }
+
+       @Override
+       public void setTaxonBase(TaxonBase<?> taxon) {
+               this.setEntity(taxon);
+               
+       }
+
+       @Override
+       public void setTaxonBaseWithoutUpdate(TaxonBase<?> taxon) {
+               setEntityWithoutUpdate(taxon);
+               
+       }
+
+       @Override
+       public TaxonBase<?> getTaxonBase() {
+               
+               return getEntity();
+       }
 }
index 088ce9099cdbb0811a6e77361f2e04fd5ed6bf75..0f1db1a8ded4de9e711ca3ba4c22c301d622c19a 100644 (file)
@@ -108,4 +108,10 @@ public class TaxonOfRelationshipElement extends  AbstractIdentifiableEntityDetai
             }
         }
     }
+
+       @Override
+       public void fillFields() {
+               super.fillFields();
+               checkbox_doubtful.setSelection(getEntity().isDoubtful());
+       }
 }
\ No newline at end of file
index bcafe78e4de38f16f89a964bb8054b606e006db5..c6adbe6d149f583a0d2e38be6ce0a6d8e4fe5808 100644 (file)
@@ -277,4 +277,24 @@ public class TaxonRelationshipDetailElement extends AbstractSingleSourceElement<
         // TODO Auto-generated method stub
         return null;
     }
+
+       @Override
+       public void fillFields() {
+               taxon = getEntity().getFromTaxon();
+               if (combo_misappliedRelationshipType!= null) {
+                       combo_misappliedRelationshipType.setSelection(getEntity().getType());
+               }
+               
+               super.singleSourceSection.fillFields();
+               selection_relatedTaxon.setEntity(getEntity().getToTaxon());;
+               checkBoxDoubtful.setSelection(getEntity().isDoubtful());
+               
+               sensuReference.setEntity(taxon.getSec());;
+               text_sensu_microreference.setText(taxon.getSecMicroReference());
+               text_appendedPhrase.setText(taxon.getAppendedPhrase());
+
+           checkbox_published.setSelection(taxon.isPublish());;
+           //taxonElement.fillFields();???
+               
+       }
 }
\ No newline at end of file
index 2a50d367c46edc0524723517b3d9c10086d417bb..c0c2ce060cd2ebb743614f36bed4927a85d56cfa 100644 (file)
@@ -70,6 +70,11 @@ public class TaxonRelationshipDetailSection extends AbstractCdmDetailSection<Tax
                TaxonName name = HibernateProxyHelper.deproxy(taxon.getName());
                setName(name);
        }
+       
+       @Override
+    public void setTaxonBaseWithoutUpdate(TaxonBase taxon) {
+               this.setTaxonBase(taxon);
+       }
 
        @Override
        public TaxonBase getTaxonBase() {
index dfc7fb56f127b7966028cfa4793c2cb88f39a8ff..b4a36a69579921ba7c1d78f1974354613957c0a0 100644 (file)
@@ -102,4 +102,17 @@ public class UserDetailElement extends AbstractCdmDetailElement<User> {
                                        checkbox_credentialsNonExpired.getSelection());
                }
        }
+
+       @Override
+       public void fillFields() {
+               // TODO implement
+               //text_username;
+               //text_emailAdress;
+               //selection_person;
+               //checkbox_credentialsNonExpired;
+               //checkbox_enabled;
+               //checkbox_accountNonLocked;
+               //checkbox_accountNonExpired;
+               
+       }
 }
\ No newline at end of file
index e9661677af54e8717d47ed31b27995eccee23832..d7ea8df74a0a9232050fa6267c028051caa1048b 100644 (file)
@@ -566,4 +566,17 @@ public class UseRecordDetailElement extends
        public void widgetDefaultSelected(SelectionEvent e) {\r
                // TODO Auto-generated method stub\r
        }\r
+
+\r
+       @Override\r
+       public void fillFields() {\r
+               // TODO \r
+               //combo_UseCategory;\r
+               //combo_UseSubCategory;\r
+               //combo_PlantPart;\r
+               //combo_Country;\r
+               //combo_HumanGroup;\r
+               //combo_EthnicGroup;\r
+       }\r
+\r
 }
index a94c375283e74454512bf568fea961a2d5e30a75..08faa91be9a6ed7a31a79975798a61fa44de1380 100644 (file)
@@ -178,6 +178,36 @@ public class CdmSectionPart<T> extends SectionPart
 
                return true;
        }
+       
+       public boolean setFormInputWithoutUpdate(Object input) {
+        if (formSection.isDisposed()){
+            return false;
+        }
+
+           this.rootInput = input;
+           //FIXME (CM): Need to fix this part of the design.
+           //The design seems to be locked to the idea that only one
+           // entity (either from the navigator or the editor) drives
+           // the detail view. In the case of multiple inputs the only workaround
+           // is checking the type and extracting relevant objects.
+               if (input instanceof IElementHasDetails) {
+                       input = ((IElementHasDetails) input).getData();
+               }
+
+               if ((input instanceof TaxonBase)
+                               && (formSection instanceof ITaxonBaseDetailSection )) {
+                       
+                       //if (!((TaxonBase<?>) input).getTitleCache().equals(((ITaxonBaseDetailSection) formSection).getTaxonBase().getTitleCache())) {
+                               ((ITaxonBaseDetailSection) formSection)
+                                       .setTaxonBaseWithoutUpdate((TaxonBase<?>) input);
+                       
+                       //}
+                       
+                       return true;
+               }               
+               //actually only for Taxon Details...
+               return this.setFormInput( input);
+       }
 
        @Override
        public void propertyChange(PropertyChangeEvent event) {
index 3439d5d19a0bdf3f039a2cee29c3e6bf41d7398e..1ada7b30bf174d549894021a3394442b3669e794 100644 (file)
@@ -156,6 +156,19 @@ public abstract class AbstractCdmDataViewer extends Viewer {
 
 //             managedForm.reflow(true);
        }
+       
+       
+       public void refresh_withoutnew_build() {
+               if(input!=null){
+                       IFormPart[] parts = managedForm.getParts();
+                       for (IFormPart part: parts) {
+                               if(part instanceof CdmSectionPart) {    
+                                       ((CdmSectionPart<?>)part).setFormInputWithoutUpdate(input);
+                               }
+                       }
+               }               
+
+       }
 
        public void layout(){
                body.layout();
index a9f2edb3cd86541c0a38e6b725e149c07057e73a..34beaae859d8c78a3d14ff88a286d665df13b83f 100644 (file)
@@ -217,9 +217,7 @@ public abstract class AbstractCdmEditorPart<V extends Viewer>
             if (part instanceof IBulkEditor){
                ((IBulkEditor)part).setSelection(createSelection(object));
             }
-//            if (part instanceof ITaxonEditor){
-//             ((ITaxonEditor)part).setDetailsChanged();
-//            }
+
         }
     }
 
index 88b18a75477482f14e3e3ba351b08dd7adda3116..4197b213b035ba9e4a21ad6268bd369a0fea09a6 100644 (file)
@@ -99,7 +99,7 @@ public class DetailsPartE4 extends AbstractCdmEditorPart<DetailsViewerE4> implem
     }
 
     public void refreshSelection(){
-        selectionChanged_internal(new StructuredSelection(this.viewer.getInput()), selectionProvidingPart, thisPart);
+       this.viewer.refresh_withoutnew_build();
     }
 
     @Override
index 5e8105d367c20651bcd22adb2f20b80350cae19a..c9e535f953af1b8146bbbf8a3c172fd980eb4b27 100755 (executable)
@@ -984,7 +984,8 @@ public class DetailsViewerE4 extends AbstractCdmDataViewer {
     @Optional
     private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_DETAILS)boolean refresh){
         if(refresh){
-            refresh();
+            //refresh_withoutnew_build(); this would use the update without creation of all fields
+               refresh();
         }
     }