move handleEvent to base class in AbstractOriginalSourceElement
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 26 Jul 2022 20:34:54 +0000 (22:34 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 26 Jul 2022 20:34:54 +0000 (22:34 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/AbstractOriginalSourceElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/IdentifiableSourceElement.java

index 5af76525a808d7456980eecc9c40da01f73baa94..29c949c7a6b8d50da86064525f1f76f1c972283a 100644 (file)
@@ -83,24 +83,10 @@ public class DescriptionElementSourceElement extends
 
        @Override
        public void handleEvent(Object eventSource) {
-               if (eventSource == text_idInSource) {
-                       getEntity().setIdInSource(text_idInSource.getText());
-               } else if (eventSource == text_idNamespace) {
-                       getEntity().setIdNamespace(text_idNamespace.getText());
-               } else if (eventSource == selection_reference) {
-                   getEntity().setCitation(selection_reference.getSelection());
-               } else if (eventSource == text_referenceDetail) {
-                       getEntity().setCitationMicroReference(
-                                       text_referenceDetail.getText());
-               } else if (eventSource == text_originalInfo) {
-                       getEntity().setOriginalInfo(
-                                       text_originalInfo.getText());
-               } else if (eventSource == selection_name) {
-                       getEntity().setNameUsedInSource(selection_name.getSelection());
-               }
-               else if(eventSource == combo_origsourcetype){
-                   getEntity().setType(combo_origsourcetype.getSelection());
-               }
+           super.handleEvent(eventSource);
+        if (eventSource == selection_name) {
+            getEntity().setNameUsedInSource(selection_name.getSelection());
+        }
        }
 
        @Override
index 0ef5c0304ebbe65daad32b8a71e77e840e98b188..284ace50a90d25ed604429aa4c00ab767542b484 100644 (file)
@@ -146,4 +146,26 @@ public abstract class AbstractOriginalSourceElement<T extends OriginalSourceBase
                }
                }
        }
+
+    @Override
+    public void handleEvent(Object eventSource) {
+        if(eventSource == text_idInSource){
+            getEntity().setIdInSource(text_idInSource.getText());
+        }
+        else if(eventSource == text_idNamespace){
+            getEntity().setIdNamespace(text_idNamespace.getText());
+        }
+        else if(eventSource == selection_reference){
+            getEntity().setCitation(selection_reference.getSelection());
+        }
+        else if(eventSource == text_referenceDetail){
+            getEntity().setCitationMicroReference(text_referenceDetail.getText());
+        }
+        else if(eventSource == text_originalInfo){
+            getEntity().setOriginalInfo(text_originalInfo.getText());
+        }
+        else if(eventSource == combo_origsourcetype){
+            getEntity().setType(combo_origsourcetype.getSelection());
+        }
+    }
 }
\ No newline at end of file
index 699e7e4a2e22b4b379217b792e7acdc43063716e..96de77e9f05c8834a06dd66784d784c58c6c0288 100644 (file)
@@ -79,22 +79,6 @@ public class IdentifiableSourceElement extends AbstractOriginalSourceElement<Ide
 
        @Override
        public void handleEvent(Object eventSource) {
-               if(eventSource == text_idInSource){
-                       getEntity().setIdInSource(text_idInSource.getText());
-               }
-               else if(eventSource == text_idNamespace){
-                       getEntity().setIdNamespace(text_idNamespace.getText());
-               }
-               if(eventSource == selection_reference){
-                       getEntity().setCitation(selection_reference.getSelection());
-               }
-               else if(eventSource == text_referenceDetail){
-                       getEntity().setCitationMicroReference(text_referenceDetail.getText());
-               }
-               else if(eventSource == text_originalInfo){
-                       getEntity().setOriginalInfo(text_originalInfo.getText());
-               } else if(eventSource == combo_origsourcetype){
-                       getEntity().setType(combo_origsourcetype.getSelection());
-               }
+           super.handleEvent(eventSource);
        }
 }