// $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.
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence;
-import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EntityDetailType;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
/**
* <p>
* DerivedUnitBaseDetailElement class.
* </p>
- *
+ *
* @author n.hoffmann
* @created Jun 24, 2010
* @version 1.0
* <p>
* Constructor for DerivedUnitBaseDetailElement.
* </p>
- *
+ *
* @param formFactory
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
* object.
/** {@inheritDoc} */
@Override
- protected void createControls(ICdmFormElement formElement,
- DerivedUnitFacade entity, int style) {
- // Disable for now
- // text_derivedUnitDefinitions =
- // formFactory.createTextWithLabelElement(formElement,
- // "Specimen Definition",
- // facade.getDerivedUnitDefinition(CdmStore.getDefaultLanguage()),
- // style);
- text_barcode = formFactory.createTextWithLabelElement(formElement,
- "Barcode", entity.getBarcode(), style);
- text_catalogNumber = formFactory
- .createTextWithLabelElement(formElement, "Catalog Number",
- entity.getCatalogNumber(), style);
-
- try {
- combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class,
- formElement, "Preservation Method",
- entity.getPreservationMethod(), style);
- } catch (MethodNotSupportedByDerivedUnitTypeException e) {
- // we ignore this
- StoreUtil.info(e.getMessage());
- }
- selection_storedUnder = formFactory
- .createSelectionElement(TaxonNameBase.class,
- getConversationHolder(), formElement, "Stored Under",
- entity.getStoredUnder(), EntitySelectionElement.ALL,
- style);
-
- try {
- text_exsicatum = formFactory.createTextWithLabelElement(
- formElement, "Exsiccatum", entity.getExsiccatum(), style);
- } catch (MethodNotSupportedByDerivedUnitTypeException e) {
- // we ignore this
- StoreUtil.info(e.getMessage());
- }
-
- section_duplicates = (SpecimenCollectionDetailSection) formFactory
- .createEntityDetailSection(
- EntityDetailType.SPECIMEN_COLLECTION,
- getConversationHolder(), formElement, Section.TWISTIE);
- section_duplicates
- .setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- section_duplicates.setEntity(entity);
-
- section_source = (SourceCollectionDetailSection) formFactory
- .createEntityDetailSection(
- EntityDetailType.IDENTIFIABLE_SOURCE_COLLECTION,
- getConversationHolder(), formElement, Section.TWISTIE);
- section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
- section_source.setEntity(entity);
- }
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ // Disable for now
+ // text_derivedUnitDefinitions =
+ // formFactory.createTextWithLabelElement(formElement,
+ // "Specimen Definition",
+ // facade.getDerivedUnitDefinition(CdmStore.getDefaultLanguage()),
+ // style);
+ text_barcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
+ text_catalogNumber = formFactory.createTextWithLabelElement(formElement, "Catalog Number", entity.getCatalogNumber(), style);
+
+ try {
+ combo_preservationMethod = formFactory.createTermComboElement(PreservationMethod.class, formElement, "Preservation Method", entity.getPreservationMethod(), style);
+ } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+ // we ignore this
+ AbstractUtility.info(e.getMessage());
+ }
+ selection_storedUnder = formFactory.createSelectionElement(TaxonNameBase.class, getConversationHolder(), formElement, "Stored Under", entity.getStoredUnder(), EntitySelectionElement.ALL, style);
+
+ try {
+ text_exsicatum = formFactory.createTextWithLabelElement(formElement, "Exsiccatum", entity.getExsiccatum(), style);
+ } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+ // we ignore this
+ AbstractUtility.info(e.getMessage());
+ }
+
+ section_duplicates = formFactory.createSpecimenCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_duplicates.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_duplicates.setEntity(entity);
+
+ section_source = formFactory.createSourceCollectionDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ section_source.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ section_source.setEntity(entity);
+ }
/** {@inheritDoc} */
@Override
getEntity().setPreservationMethod(
combo_preservationMethod.getSelection());
} catch (MethodNotSupportedByDerivedUnitTypeException e) {
- StoreUtil
+ AbstractUtility
.errorDialog(
"MethodNotSupportedByDerivedUnitTypeException",
this,
try {
getEntity().setExsiccatum(text_exsicatum.getText());
} catch (Exception e) {
- StoreUtil.error(this.getClass(), e);
+ AbstractUtility.error(this.getClass(), e);
}
}
}