- added isPublished flag to DetailsView (fixes #3818)
authorPatric Plitzner <p.plitzner@bgbm.org>
Wed, 23 Oct 2013 08:44:12 +0000 (08:44 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Wed, 23 Oct 2013 08:44:12 +0000 (08:44 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonBaseDetailElement.java

index ad76f3bf5c9cd2b605cc2725c3647eb8f2239c47..bff30d7879877eaec48103dff36b25c5d9ab24f1 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
 // $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -29,7 +29,7 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * <p>
  * TaxonBaseDetailElement class.
  * </p>
  * <p>
  * TaxonBaseDetailElement class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Feb 26, 2010
  * @version 1.0
  * @author n.hoffmann
  * @created Feb 26, 2010
  * @version 1.0
@@ -48,11 +48,13 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
 
        private CheckboxElement checkbox_unplaced;
 
 
        private CheckboxElement checkbox_unplaced;
 
+       private CheckboxElement checkbox_published;
+
        /**
         * <p>
         * Constructor for TaxonBaseDetailElement.
         * </p>
        /**
         * <p>
         * Constructor for TaxonBaseDetailElement.
         * </p>
-        * 
+        *
         * @param cdmFormFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
         * @param cdmFormFactory
         *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
         *            object.
@@ -80,20 +82,22 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                                getConversationHolder(), formElement, "Secundum",
                                entity.getSec(), EntitySelectionElement.ALL,
                                style);
                                getConversationHolder(), formElement, "Secundum",
                                entity.getSec(), EntitySelectionElement.ALL,
                                style);
-               
+
                text_appendedPhrase = formFactory.createTextWithLabelElement(
                                formElement, "Appended Phrase", entity.getAppendedPhrase(),
                                SWT.NULL);
                checkbox_useNameCache = formFactory.createCheckbox(formElement,
                                "Exclude Authorship", entity.isUseNameCache(), style);
                text_appendedPhrase = formFactory.createTextWithLabelElement(
                                formElement, "Appended Phrase", entity.getAppendedPhrase(),
                                SWT.NULL);
                checkbox_useNameCache = formFactory.createCheckbox(formElement,
                                "Exclude Authorship", entity.isUseNameCache(), style);
-               
+
                if (entity instanceof Taxon) {
                        checkbox_excluded = formFactory.createCheckbox(formElement,
                                        "Taxon is excluded", ((Taxon) entity).isExcluded(), style);
                        checkbox_unplaced = formFactory.createCheckbox(formElement,
                                        "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
                }
                if (entity instanceof Taxon) {
                        checkbox_excluded = formFactory.createCheckbox(formElement,
                                        "Taxon is excluded", ((Taxon) entity).isExcluded(), style);
                        checkbox_unplaced = formFactory.createCheckbox(formElement,
                                        "Taxon is unplaced", ((Taxon) entity).isUnplaced(), style);
                }
-               
+               checkbox_published = formFactory.createCheckbox(formElement,
+                       "Taxon is published", ((Taxon) entity).isPublish(), style);
+
                checkbox_doubtful = formFactory.createCheckbox(formElement,
                                entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
        }
                checkbox_doubtful = formFactory.createCheckbox(formElement,
                                entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
        }
@@ -106,7 +110,7 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                setIrrelevant(toggleable_cache.getState(),
                                Arrays.asList(new Object[] { toggleable_cache }));
        }
                setIrrelevant(toggleable_cache.getState(),
                                Arrays.asList(new Object[] { toggleable_cache }));
        }
-       
+
        @Override
        protected void handleTitleCacheRelevantChange(PropertyChangeEvent event) {
                String title = getEntity().generateTitle();
        @Override
        protected void handleTitleCacheRelevantChange(PropertyChangeEvent event) {
                String title = getEntity().generateTitle();
@@ -130,7 +134,9 @@ public class TaxonBaseDetailElement extends AbstractIdentifiableEntityDetailElem
                } else if (eventSource == checkbox_excluded) {
                        ((Taxon) getEntity()).setExcluded(checkbox_excluded.getSelection());
                } else if (eventSource == checkbox_unplaced) {
                } else if (eventSource == checkbox_excluded) {
                        ((Taxon) getEntity()).setExcluded(checkbox_excluded.getSelection());
                } else if (eventSource == checkbox_unplaced) {
-                       ((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
+                   ((Taxon) getEntity()).setUnplaced(checkbox_unplaced.getSelection());
+               } else if (eventSource == checkbox_published) {
+                   ((Taxon) getEntity()).setPublish(checkbox_published.getSelection());
                }
        }
 }
                }
        }
 }