ref #10182: code cleaning with previous changes
authorKatja Luther <k.luther@bgbm.org>
Wed, 4 Jan 2023 14:01:30 +0000 (15:01 +0100)
committerKatja Luther <k.luther@bgbm.org>
Wed, 4 Jan 2023 14:01:30 +0000 (15:01 +0100)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OccurrenceStatusElement.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index a5f5787..b06703f
@@ -83,7 +83,7 @@ public class OccurrenceStatusElement extends AbstractSourcedEntityElement<Occurr
 
        @Override
        public SelectionArbitrator getSelectionArbitrator() {
-               // TODO Auto-generated method stub
+               // actually this view is used in the specimen wizard, so there the selection arbitrator is not needed.
                return null;
        }
 
@@ -91,14 +91,18 @@ public class OccurrenceStatusElement extends AbstractSourcedEntityElement<Occurr
        public void setBackground(Color color) {
 
                for(ICdmFormElement element : getElements()){
-                       if (element != null && (element != combo_statusType ^ (element == combo_statusType && combo_statusType.getSelection() != null))  ) {
-                               element.setBackground(color);
-                       }else {
-                               element.setBackground(colorRedSWT);
+                       if (element != null) {
+                               if (element != combo_statusType ^ (element == combo_statusType && combo_statusType.getSelection() != null)){
+                                       element.setBackground(color);
+                               }else {
+                                       element.setBackground(colorRedSWT);
+                               }
                        }
                }
                for(Control element : getControls()){
-                       element.setBackground(color);
+                       if (!element.isDisposed()){
+                           element.setBackground(color);
+                       }
                }
        }
 }
\ No newline at end of file