ref #6596 Fix FieldUnit creation when linked with taxon selection
authorPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 30 Jun 2017 14:11:03 +0000 (16:11 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 4 Jul 2017 06:16:04 +0000 (08:16 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/Messages.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/l10n/messages_de.properties
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/CreateFieldUnitHandler.java

index eca40106c0c24619bf72b6661ed74da217c01176..338eb51c8cbc842e62f359284ae1275f89274b2e 100644 (file)
@@ -50,7 +50,6 @@ public class Messages extends NLS {
     public static String ConceptContainer_SEC_REQUIRED;
     public static String ConceptGraphView_VIEWER_NAME;
        public static String ConceptViewPart_VIEWER_NAME;
-    public static String CreateFieldUnitContextMenu_CREATE_FIELD_UNIT;
        public static String CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR;
        public static String DefaultOpenSpecimenEditorForTypeSpecimenHandler_COULD_NOT_OPEN;
     public static String DefaultOpenTaxonEditorForTaxonBaseHandler_COULD_NOT_OPEN;
index eda20e6d99027f98a45920a9d875bdea3e62561d..d0a5d67def711e4626e30fa8a819da94051d215b 100644 (file)
@@ -1,4 +1,3 @@
-CreateFieldUnitContextMenu_CREATE_FIELD_UNIT=Create new field unit
 CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR=Create new field unit for %s
 SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Remove from this Sequence
 SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Reuse for other Sequence
index 92c64f0424cdfe34889b71b147ab8e6d4957b951..d823f6f1c6637b90cb2bf47e29b9809e6cf5bea7 100644 (file)
@@ -1,4 +1,3 @@
-CreateFieldUnitContextMenu_CREATE_FIELD_UNIT=Erzeuge neue Field Unit
 CreateFieldUnitContextMenu_CREATE_FIELD_UNIT_FOR=Erzeuge neue Field Unit für %s
 SingleReadSequenceContextMenu_REMOVE_FROM_SEQUENCE=Von Sequenz entfernen
 SingleReadSequenceContextMenu_REUSE_FOR_SEQUENCE=Für andere Sequenz verwenden
index f2355066f9d3e0e7d0dd82c8383dcefbc0dba663..0b3ae9783ffd9c9d1583aed7418c80acc2536fa0 100644 (file)
@@ -492,7 +492,7 @@ public class DerivateView implements IPartContentHasFactualData, IConversationEn
     public void selectionChanged(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) ISelection selection,
             @Named(IServiceConstants.ACTIVE_PART) MPart activePart, MPart thisPart)
     {
-       if(activePart == this || viewer==null){
+       if(activePart == thisPart || viewer==null){
             return;
         }
         if(viewer.getTree().isDisposed()){
index 16cbb9fc1af0af07cdb33ea9518b9feb8bb55ef3..cb5b8f30443302a0ecb51af9589f18064085a06b 100644 (file)
@@ -39,6 +39,7 @@ public class CreateFieldUnitHandler {
 
                 FieldUnit fieldUnit = FieldUnit.NewInstance();
                 fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
+
                 IndividualsAssociation association = IndividualsAssociation.NewInstance(fieldUnit);
                 TaxonDescription description;
                 if(!taxon.getDescriptions().isEmpty()){
@@ -53,6 +54,7 @@ public class CreateFieldUnitHandler {
 
                 derivateView.getConversationHolder().commit();
                 derivateView.addFieldUnit(fieldUnit);
+                derivateView.updateRootEntities();
                 derivateView.refreshTree(fieldUnit);
             }
         }
@@ -63,6 +65,7 @@ public class CreateFieldUnitHandler {
             }
             FieldUnit fieldUnit = FieldUnit.NewInstance();
             fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
+
             derivateView.getConversationHolder().commit();
             derivateView.addFieldUnit(fieldUnit);
             derivateView.updateRootEntities();