// $Id$
/**
* Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
+ * European Distributed Institute of Taxonomy
* 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.
*/
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractIdentifiableEntityDetailElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
* <p>
* TaxonBaseDetailElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Feb 26, 2010
* @version 1.0
private CheckboxElement checkbox_unplaced;
+ private CheckboxElement checkbox_published;
+
/**
* <p>
* Constructor for TaxonBaseDetailElement.
* </p>
- *
+ *
* @param cdmFormFactory
- * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
- * object.
+ * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
* @param formElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
* @param style
* a int.
*/
entity.isProtectedTitleCache(), style);
selection_secundum = formFactory
- .createSelectionElement(Reference.class,
+ .createSelectionElement(Reference.class,
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);
-
+
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_doubtful = formFactory.createCheckbox(formElement,
entity.getClass().getSimpleName() + " is doubtful", entity.isDoubtful(), style);
+
+ checkbox_published = formFactory.createCheckbox(formElement,
+ "Taxon is published", ((TaxonBase) entity).isPublish(), style);
+
}
/** {@inheritDoc} */
setIrrelevant(toggleable_cache.getState(),
Arrays.asList(new Object[] { toggleable_cache }));
}
-
+
@Override
protected void handleTitleCacheRelevantChange(PropertyChangeEvent event) {
String title = getEntity().generateTitle();
/** {@inheritDoc} */
@Override
public void handleEvent(Object eventSource) {
- if (eventSource.equals(toggleable_cache)) {
+ if (eventSource== toggleable_cache) {
handleToggleableCacheField();
- } else if (eventSource.equals(checkbox_doubtful)) {
+ } else if (eventSource == checkbox_doubtful) {
getEntity().setDoubtful(checkbox_doubtful.getSelection());
- } else if (eventSource.equals(checkbox_useNameCache)) {
+ } else if (eventSource == checkbox_useNameCache) {
getEntity().setUseNameCache(checkbox_useNameCache.getSelection());
- } else if (eventSource.equals(selection_secundum)) {
+ } else if (eventSource == selection_secundum) {
getEntity().setSec(selection_secundum.getSelection());
- } else if (eventSource.equals(text_appendedPhrase)) {
+ } else if (eventSource == text_appendedPhrase) {
getEntity().setAppendedPhrase(text_appendedPhrase.getText());
} 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());
}
}
}