fix missing publish flag for synonyms
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 14 Jan 2014 22:18:53 +0000 (22:18 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 14 Jan 2014 22:18:53 +0000 (22:18 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java

index 525d3ba3ff770f340f1f4562dd496fb69e94ee66..f3f9155f04f4a658414351118b14777e19a0cbf1 100644 (file)
@@ -97,9 +97,10 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                checkbox_doubtful = formFactory.createCheckbox(formElement,
                                entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
                
-               checkbox_published = formFactory.createCheckbox(formElement,
-                       "Taxon is published", ((TaxonBase) entity).isPublish(), style);
-
+               if (entity instanceof Taxon) {
+                       checkbox_published = formFactory.createCheckbox(formElement,
+                                       "Taxon is published", ((Taxon) entity).isPublish(), style);
+               }
        }
 
        /** {@inheritDoc} */
@@ -136,7 +137,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                } else if (eventSource == checkbox_unplaced) {
                    ((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
                } else if (eventSource == checkbox_published) {
-                   ((Taxon) getEntity()).setPublish(checkbox_published.getSelection());
+                   ((Taxon)getEntity()).setPublish(checkbox_published.getSelection());
                }
        }
 }