eu.etaxonomy.taxeditor.store/icons/bookmark.gif -text
eu.etaxonomy.taxeditor.store/icons/category.gif -text
eu.etaxonomy.taxeditor.store/icons/change.gif -text
+eu.etaxonomy.taxeditor.store/icons/character_data_derivate-16x16-32.png -text
eu.etaxonomy.taxeditor.store/icons/clear.gif -text
eu.etaxonomy.taxeditor.store/icons/close.gif -text
eu.etaxonomy.taxeditor.store/icons/close_view.gif -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MinMaxTextSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/NumberWithLabelElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PartialElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/PointElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/RootElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/AbstractCdmComposite.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/DerivedUnitGeneralDetailElementMVC.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/GeographicPointElement.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/combo/EnumTermCombo.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/combo/EnumTermComboController.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/element/DateElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenGeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenGeneralDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/derivedUnit/PreservedSpecimenSourceCollectionDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AbstractSampleDesignationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AbstractUnboundEntityCollectionSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationCloningDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationCloningDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationGeneralDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationPrimerDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/AmplificationPrimerDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/CurrentSampleDesignationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaQualityDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSampleGeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSampleGeneralDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/PrimerGeneralDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailElement.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationHistoryDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SampleDesignationTextDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceContigFileCollectionDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailSection.java -text
Bundle-ManifestVersion: 2
Bundle-Name: Application
Bundle-SymbolicName: eu.etaxonomy.taxeditor.application;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.TaxonomicEditorPlugin
Bundle-Vendor: EDIT
Bundle-Localization: OSGI-INF/l10n/plugin
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
/**
* Prefix to declare the version as beta
*/
- private static final String BETA_PREFIX = "[BETA]";
+ private static final String BETA_PREFIX = "[Campanula CDM 3.4]";
/**
* @return
Bundle-ManifestVersion: 2
Bundle-Name: Bulkeditor Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.4.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.4.0-SNAPSHOT.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="lib" path="lib/batik-util-1.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/batik-xml-1.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-commons-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-ext-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-io-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-print-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-remote-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.3.8-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.3.8-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cglib-nodep-2.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/com.springsource.org.aopalliance-1.0.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/com.springsource.org.apache.commons.logging-1.1.1.jar"/>
Bundle-ManifestVersion: 2
Bundle-Name: CDM Library Dependencies Plugin
Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Eclipse-BundleShape: dir
Export-Package: com.google.api,
com.google.api.detect,
lib/batik-util-1.7.jar,
lib/batik-xml-1.7.jar,
lib/c3p0-0.9.2.jar,
- lib/cdmlib-commons-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-commons-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-ext-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-ext-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-io-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-io-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-model-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-model-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-persistence-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-persistence-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-print-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-print-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-remote-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-remote-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-services-3.3.8-SNAPSHOT-sources.jar,
- lib/cdmlib-services-3.3.8-SNAPSHOT.jar,
lib/cglib-nodep-2.2.2.jar,
lib/com.springsource.org.aopalliance-1.0.0.jar,
lib/com.springsource.org.apache.commons.logging-1.1.1.jar,
lib/h2mig_pagestore_addon.jar,
lib/spring-security-remoting-3.1.3.RELEASE.jar,
lib/jena-core-2.11.2.jar,
- lib/jena-iri-1.0.2.jar
+ lib/jena-iri-1.0.2.jar,
+ lib/cdmlib-commons-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-commons-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-ext-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-ext-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-io-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-io-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-model-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-model-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-persistence-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-persistence-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-print-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-print-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-remote-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-remote-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-services-3.4.0-SNAPSHOT-sources.jar,
+ lib/cdmlib-services-3.4.0-SNAPSHOT.jar
Import-Package: eu.etaxonomy.cdm.api.application
lib/batik-util-1.7.jar,\\r
lib/batik-xml-1.7.jar,\\r
lib/c3p0-0.9.2.jar,\\r
- lib/cdmlib-commons-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-commons-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-ext-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-ext-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-io-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-io-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-model-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-model-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-persistence-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-persistence-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-print-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-print-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-remote-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-remote-3.3.8-SNAPSHOT.jar,\\r
- lib/cdmlib-services-3.3.8-SNAPSHOT-sources.jar,\\r
- lib/cdmlib-services-3.3.8-SNAPSHOT.jar,\\r
lib/cglib-nodep-2.2.2.jar,\\r
lib/com.springsource.org.aopalliance-1.0.0.jar,\\r
lib/com.springsource.org.apache.commons.logging-1.1.1.jar,\\r
lib/odfdom-0.8.jar,\\r
lib/h2mig_pagestore_addon.jar,\\r
lib/spring-security-remoting-3.1.3.RELEASE.jar,\\r
+ lib/cdmlib-commons-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-commons-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-ext-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-ext-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-io-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-io-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-model-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-model-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-persistence-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-persistence-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-print-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-print-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-remote-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-remote-3.4.0-SNAPSHOT.jar,\\r
+ lib/cdmlib-services-3.4.0-SNAPSHOT-sources.jar,\\r
+ lib/cdmlib-services-3.4.0-SNAPSHOT.jar,\\r
+ lib/spring-security-remoting-3.1.3.RELEASE.jar,\\r
lib/jena-core-2.11.2.jar,\\r
lib/jena-iri-1.0.2.jar\r
jars.compile.order = .\r
<parent>\r
<groupId>eu.etaxonomy</groupId>\r
<artifactId>taxeditor-parent</artifactId>\r
- <version>3.3.8-SNAPSHOT</version>\r
+ <version>3.4.0-SNAPSHOT</version>\r
</parent>\r
<modelVersion>4.0.0</modelVersion>\r
<artifactId>eu.etaxonomy.taxeditor.cdmlib</artifactId>\r
Bundle-ManifestVersion: 2
Bundle-Name: Editor Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.editor;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: OSGI-INF/l10n/plugin
commandId="taxeditor-editor.useExistingImage"
label="%command.label.50"
style="push">
- <visibleWhen
- checkEnabled="false">
+ <visibleWhen>
<reference
definitionId="isImageGallery">
</reference>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
public class DataImportEditorContextMenu extends CompoundContributionItem {
@Override
public void fill(Menu menu, int index) {
final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- final IEditorPart activeEditor = window.getActivePage().getActiveEditor();
+ final IEditorPart activeEditor = AbstractUtility.getActiveEditor();
final ISelection selection = window.getActivePage().getSelection();
if(selection instanceof StructuredSelection){
final StructuredSelection structuredSelection = (StructuredSelection)selection;
TransientCdmRepository repo =
new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
configurator.setCdmAppController(repo);
+ configurator.setAddMediaAsMediaSpecimen(true);
+ configurator.setDeterminationOnFieldUnitLevel(true);
CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
importer.invoke(configurator);
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.dto.DerivateHierarchyDTO;
import eu.etaxonomy.cdm.api.service.pager.Pager;
import eu.etaxonomy.cdm.api.service.search.SearchResult;
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
return defaultService.findWithoutFlush(uuid);
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listFieldUnitsByAssociatedTaxon(java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Collection<FieldUnit> listFieldUnitsByAssociatedTaxon(Set<TaxonRelationshipEdge> includeRelationships,
+ Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
+ List<String> propertyPaths) {
+ return defaultService.listFieldUnitsByAssociatedTaxon(includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#assembleDerivateHierarchyDTO(eu.etaxonomy.cdm.model.occurrence.FieldUnit, java.util.UUID)
+ */
+ @Override
+ public DerivateHierarchyDTO assembleDerivateHierarchyDTO(FieldUnit fieldUnit, UUID associatedTaxonUuid) {
+ return defaultService.assembleDerivateHierarchyDTO(fieldUnit, associatedTaxonUuid);
+ }
+
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getNonCascadedAssociatedElements(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.api.conversation.ConversationHolder)
*/
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.IContextListener;
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
*/
public class DerivateView extends EditorPart implements IPartContentHasFactualData, IDirtyMarkable,
IConversationEnabled, IPartContentHasDetails, IPartContentHasMedia, IPartContentHasSupplementalData,
- IContextListener, ISelectionChangedListener {
+ ISelectionChangedListener {
/**
* Key used for storing a single DerivateView in a memento
* Default constructor
*/
public DerivateView() {
- CdmStore.getContextManager().addContextListener(this);
}
/* (non-Javadoc)
changed(null);
}
+ /**
+ * Refreshes the derivate hierarchy tree and expands the tree
+ * to show and select the given object.
+ *
+ * @param expandTo the object to which the tree should be expanded
+ */
+ public void refreshTree(Object expandTo){
+ refreshTree();
+ TreeSelection selection = (TreeSelection) viewer.getSelection();
+ viewer.expandToLevel(selection.getFirstElement(), 1);
+ viewer.setSelection(new StructuredSelection(new TreeNode(expandTo)));
+ }
+
/**
* Refreshes the derivate hierarchy tree
*/
viewer.refresh();
}
+
private void generateMultiLinkSingleReads() {
Set<SingleRead> multiLinkSingleReads = new HashSet<SingleRead>();
for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
return this.multiLinkSingleReads;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void contextStop(IMemento memento, IProgressMonitor monitor) {
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void contextStart(IMemento memento, IProgressMonitor monitor) {
-// if(memento == null){
-// return;
-// }
-// IMemento editorMementos = memento.getChild(DERIVATE_VIEW_MEMENTO_KEY);
-// DerivateViewEditorInput input = new DerivateViewEditorInput(UUID.fromString(editorInput.getString(DerivateViewEditorInput.UUID_MEMENTO_KEY)));
-// try {
-// EditorUtil.open(input);
-// } catch (PartInitException e) {
-// AbstractUtility.error(getClass(), "Error opening an editor window", e);
-// }
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void contextRefresh(IProgressMonitor monitor) {
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
-// if (!conversation.isBound()) {
-// conversation.bind();
-// }
-// conversation.close();
-// if(memento == null){
-// return;
-// }
-//
-// IEditorInput input = getEditorInput();
-// if(input instanceof IPersistable){
-// memento.createChild(DERIVATE_VIEW_MEMENTO_KEY);
-// ((IPersistable) input).saveState(memento);
-// }
- }
-
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
//context menu for TissueSample
else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
createMenuItem(addMenu, "DnaSample", selectedTreeNode, DnaSample.class, null);
+ createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media);
}
//context menu for DnaSample
else if(selectedTreeNode.getValue() instanceof DnaSample){
createMenuItem(addMenu, "Consensus Sequence", selectedTreeNode, Sequence.class, null);
+ createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media);
}
//context menu for Sequence
else if(selectedTreeNode.getValue() instanceof Sequence){
*/
@Override
public void widgetSelected(SelectionEvent e) {
+ Object createdElement = null;
Object selectedDerivate = selectedNode.getValue();
if(selectedDerivate instanceof DnaSample){
DnaSample dnaSample = (DnaSample)selectedDerivate;
if(childClass.equals(Sequence.class)){
- dnaSample.addSequence(Sequence.NewInstance(""));//why does this not have DnaSample as constructor parameter?
+ Sequence newInstance = Sequence.NewInstance("");
+ dnaSample.addSequence(newInstance);//why does this not have DnaSample as constructor parameter?
+ createdElement = newInstance;
}
}
else if(selectedDerivate instanceof Sequence){
- ((Sequence) selectedDerivate).addSingleRead(SingleRead.NewInstance());
+ SingleRead newInstance = SingleRead.NewInstance();
+ ((Sequence) selectedDerivate).addSingleRead(newInstance);
+ createdElement = newInstance;
}
else if(selectedDerivate instanceof SpecimenOrObservationBase && DerivedUnit.class.isAssignableFrom(childClass)){
SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedDerivate;
specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, derivedUnit, DerivationEventType.GATHERING_IN_SITU()));
derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
derivedUnit.getTitleCache(); //update title cache
+ createdElement = derivedUnit;
}
//refresh view
if(activePart instanceof DerivateView){
DerivateView derivateView = (DerivateView)activePart;
derivateView.changed(null);
- derivateView.refreshTree();
+ derivateView.refreshTree(createdElement);
}
}
}
<feature
id="eu.etaxonomy.taxeditor.feature.platform"
label="Taxeditor Dependencies"
- version="3.3.8.qualifier"
+ version="3.4.0.qualifier"
os="linux,macosx,win32"
ws="cocoa,gtk,win32"
arch="x86,x86_64">
- <!--license url="http://www.eclipse.org/legal/epl-v10.html">
- The contents of this file are subject to the Eclipse Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-http://www.eclipse.org/legal/epl-v10.html
-
-Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
- </license-->
-
<url>
<update label="EDIT Taxonomic Editor" url="http://wp5.e-taxonomy.eu/taxeditor/update"/>
</url>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eu.etaxonomy.taxeditor.feature.platform</artifactId>
<feature
id="eu.etaxonomy.taxeditor.feature"
label="Taxonomic Editor"
- version="3.3.8.qualifier"
+ version="3.4.0.qualifier"
provider-name="EDIT"
plugin="eu.etaxonomy.taxeditor.application"
os="linux,macosx,win32"
[Enter Copyright Description here.]
</copyright>
- <!--license url="http://www.mozilla.org/MPL/">
- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-http://www.mozilla.org/MPL/
-
-Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
- </license-->
-
<url>
<update label="EDIT Taxonomic Editor" url="http://cybertaxonomy.eu/download/taxeditor/update/"/>
</url>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>eu.etaxonomy.taxeditor.feature</artifactId>
Bundle-ManifestVersion: 2
Bundle-Name: Help
Bundle-SymbolicName: eu.etaxonomy.taxeditor.help; singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.help.Activator
Bundle-Vendor: EDIT
Require-Bundle: org.eclipse.ui,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: Navigation Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.navigation;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.cdm,
eu.etaxonomy.taxeditor.navigation,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: Printpublisher Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.printpublisher;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Require-Bundle: org.eclipse.osgi,
org.eclipse.ui,
eu.etaxonomy.taxeditor.cdmlib,
<parent>
<artifactId>taxeditor-parent</artifactId>
<groupId>eu.etaxonomy</groupId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Bundle-ManifestVersion: 2
Bundle-Name: DataStore Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
Bundle-Vendor: EDIT
Export-Package: eu.etaxonomy.cdm,
org.eclipse.jface.text,
org.eclipse.ui.forms,
eu.etaxonomy.taxeditor.cdmlib,
- org.eclipse.nebula.widgets.compositetable;bundle-version="1.0.0"
+ org.eclipse.nebula.widgets.compositetable;bundle-version="1.0.0",
+ org.eclipse.core.databinding,
+ org.eclipse.core.databinding.beans,
+ org.eclipse.core.databinding.observable,
+ org.eclipse.core.databinding.property,
+ org.eclipse.jface.databinding
Import-Package: org.eclipse.core.commands,
org.eclipse.core.commands.operations,
org.eclipse.core.expressions,
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
public static final String SINGLE_READ_DERIVATE = "single_read_derivate";
public static final String SINGLE_READ_DERIVATE_MULTILINK = "single_read_derivate_multilink";
+ public static final String CHARACTER_DATA_DERIVATE = "character_data_derivate";
+
/***************************************************************************
"single_read_derivate-16x16-32.png");
registerImage(registry, SINGLE_READ_DERIVATE_MULTILINK,
"single_read_derivate_multilink-16x16-32.png");
+ registerImage(registry, CHARACTER_DATA_DERIVATE,
+ "character_data_derivate-16x16-32.png");
+
}
private void registerImage(ImageRegistry registry, String key,
/**
- *
+ *
*/
package eu.etaxonomy.taxeditor.parser;
public class ParseHandler{
private TaxonNameBase taxonNameBase;
-
+
private class MatchMatrix {
List<TaxonNameBase> duplicateNames = new ArrayList<TaxonNameBase>();
-
+
List<INomenclaturalReference> duplicateReferences = new ArrayList<INomenclaturalReference>();
List<INomenclaturalReference> duplicateInReferences = new ArrayList<INomenclaturalReference>();
private NonViralName name;
private boolean doResolveInReferences;
-
+
/**
- * Creates a new instance
- *
+ * Creates a new instance
+ *
* @param textWidget
* @param name
*/
this.name = (NonViralName) HibernateProxyHelper.deproxy(name);
}
}
-
+
/**
* Factory method to create a new instance of the this class
*
*/
public static ParseHandler NewInstance(TaxonNameBase name){
return new ParseHandler(name);
-
+
}
-
+
/**
* Parses a given string and returns a <code>TaxonNameBase</code> instance with the
* results of the parsing.
// if (name.hasProblem()) {
// name.setFullTitleCache(unparsedNameString);
// }
-
+
return name;
}
-
+
public static TaxonNameBase parseName(String unparsedNameString, Rank rank){
TaxonNameBase name = nonViralNameParser.parseFullName(unparsedNameString,
PreferencesUtil.getPreferredNomenclaturalCode(), rank);
-
+
return name;
}
-
+
/**
* Creates an empty <code>TaxonNameBase</code> instance with the nomenclatural code
* currently set in preferences.
public static TaxonNameBase createEmptyName(){
return nonViralNameParser.getNonViralNameInstance("", PreferencesUtil.getPreferredNomenclaturalCode());
}
-
+
/**
* Parses the string that was entered into the text widget and returns a
* NonViralName object that resulted from the parsing process.
* @return The parsed NonViralName object
*/
public NonViralName parse(String unparsedNameString){
-
+
// String unparsedNameString = "";
// try {
// Method getText;
// // we should never get here
// StoreUtil.error(this.getClass(), "Error trying to invoke getText method", e);
// }
-
-
+
+
nonViralNameParser.parseReferencedName(name, unparsedNameString,
name.getRank(), true);
// if (name.hasProblem()) {
// name.setFullTitleCache(unparsedNameString);
// }
-
+
return name;
}
-
+
/**
* Parses the string that was entered into the text widget and returns a
* NonViralName object that resulted from the parsing process.
* @return The parsed NonViralName object
*/
public NonViralName parseAndResolveDuplicates(String unparsedNameString){
-
+
NonViralName parsedName = parse(unparsedNameString);
-
+
MatchMatrix matchMatrix = findMatches(parsedName);
-
+
resolveDuplicates(parsedName, matchMatrix);
-
+
return parsedName;
}
-
-
-
-
- /**
+
+
+
+
+ /**
* @param name The name to resolve duplicates for.
*/
private void resolveDuplicates(NonViralName name, MatchMatrix matchMatrix) {
resolveDuplicateNames(name, matchMatrix);
-
+
resolveAllDuplicateAuthors(name, matchMatrix);
-
+
resolveDuplicateReferences(name, matchMatrix);
-
- if(matchMatrix.duplicateInReferences != null)
- resolveDuplicateInReferences(name, matchMatrix);
+
+ if(matchMatrix.duplicateInReferences != null) {
+ resolveDuplicateInReferences(name, matchMatrix);
+ }
}
- /**
+ /**
* @param name The name to resolve duplicates for.
*/
private void resolveDuplicateNames(NonViralName name, MatchMatrix matchMatrix) {
-
+
if (matchMatrix.duplicateNames.size() == 1){
name = (NonViralName) matchMatrix.duplicateNames.iterator().next();
}else if(matchMatrix.duplicateNames.size() > 1){
}
}
- /**
+ /**
* @param name The name to resolve duplicates for.
*/
private void resolveDuplicateReferences(NonViralName name, MatchMatrix matchMatrix) {
if(matchMatrix.duplicateReferences.size() == 1){
// exactly one match. We assume that the user wants this reference
- INomenclaturalReference duplicate = matchMatrix.duplicateReferences.iterator().next();
+ INomenclaturalReference duplicate = matchMatrix.duplicateReferences.iterator().next();
name.setNomenclaturalReference(duplicate);
}else if(matchMatrix.duplicateReferences.size() > 1){
// FIXME TODO resolve multiple duplications. Use first match for a start
INomenclaturalReference duplicate = matchMatrix.duplicateReferences.iterator().next();
name.setNomenclaturalReference(duplicate);
- }
+ }
}
- /**
+ /**
* @param name The name to resolve duplicates for.
*/
private void resolveDuplicateInReferences(NonViralName name, MatchMatrix matchMatrix) {
Reference reference = (Reference) HibernateProxyHelper.deproxy(name.getNomenclaturalReference());
-
+
if(matchMatrix.duplicateInReferences.size() > 0){
Reference inReference = (Reference) matchMatrix.duplicateInReferences.iterator().next();
reference.setInReference(inReference);
MessagingUtils.warn(this.getClass(), reference.getTitleCache());
}
}
-
- /**
+
+ /**
* @param name The name to resolve duplicates for.
*/
private void resolveAllDuplicateAuthors(NonViralName name, MatchMatrix matchMatrix) {
-
+
if(matchMatrix.duplicateCombinationAuthorTeams.size() > 0){
name.setCombinationAuthorTeam(matchMatrix.duplicateCombinationAuthorTeams.iterator().next());
Reference reference = (Reference) name.getNomenclaturalReference();
if(reference != null){
- reference.setAuthorTeam(matchMatrix.duplicateCombinationAuthorTeams.iterator().next());
+ reference.setAuthorship(matchMatrix.duplicateCombinationAuthorTeams.iterator().next());
}
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
-
+
if(matchMatrix.duplicateExCombinationAuthorTeams.size() > 0){
name.setExCombinationAuthorTeam(matchMatrix.duplicateExCombinationAuthorTeams.iterator().next());
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
-
+
if(matchMatrix.duplicateBasionymAuthorTeams.size() > 0){
name.setBasionymAuthorTeam(matchMatrix.duplicateBasionymAuthorTeams.iterator().next());
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
-
+
if(matchMatrix.duplicateExBasionymAuthorTeams.size() > 0){
name.setExBasionymAuthorTeam(matchMatrix.duplicateExBasionymAuthorTeams.iterator().next());
// FIXME TODO resolve multiple duplications. We use first match for a start.
}
}
-
- /**
+
+ /**
* Splits a NonViralName into its parts and calls methods to find matches for these
* parts in the database.
- *
+ *
* @param name The NonViralName to find matches for.
*/
private MatchMatrix findMatches(NonViralName name){
-
+
MatchMatrix matchMatrix = new MatchMatrix();
-
+
matchMatrix.duplicateNames = findMatchingLatinNames(name);
-
- matchMatrix.duplicateCombinationAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getCombinationAuthorTeam());
- matchMatrix.duplicateExCombinationAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getExCombinationAuthorTeam());
- matchMatrix.duplicateBasionymAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getBasionymAuthorTeam());
- matchMatrix.duplicateExBasionymAuthorTeams = findMatchingAuthors((TeamOrPersonBase) name.getExBasionymAuthorTeam());
-
+
+ matchMatrix.duplicateCombinationAuthorTeams = findMatchingAuthors(name.getCombinationAuthorTeam());
+ matchMatrix.duplicateExCombinationAuthorTeams = findMatchingAuthors(name.getExCombinationAuthorTeam());
+ matchMatrix.duplicateBasionymAuthorTeams = findMatchingAuthors(name.getBasionymAuthorTeam());
+ matchMatrix.duplicateExBasionymAuthorTeams = findMatchingAuthors(name.getExBasionymAuthorTeam());
+
INomenclaturalReference nomenclaturalReference = name.getNomenclaturalReference();
-
- // check if the reference has an inreference and also check if the inReference already exists
+
+ // check if the reference has an inreference and also check if the inReference already exists
if(nomenclaturalReference != null){
Reference inReference = ((Reference)nomenclaturalReference).getInReference();
if(inReference != null){
matchMatrix.duplicateInReferences = findMatchingNomenclaturalReference(inReference);
}
}
-
+
matchMatrix.duplicateReferences = findMatchingNomenclaturalReference(nomenclaturalReference);
-
+
return matchMatrix;
}
-
+
/**
* @param nomenclaturalReference The NomenclaturalReference to find matches for.
* @return A <code>List</code> of possibly matching NomenclaturalReference's.
*/
private List<INomenclaturalReference> findMatchingNomenclaturalReference(INomenclaturalReference nomenclaturalReference) {
- if(nomenclaturalReference == null) return new ArrayList<INomenclaturalReference>();
+ if(nomenclaturalReference == null) {
+ return new ArrayList<INomenclaturalReference>();
+ }
try{
return CdmStore.getService(ICommonService.class).findMatching(nomenclaturalReference, MatchStrategyConfigurator.ReferenceMatchStrategy());
}catch (MatchException e) {
if(authorTeam == null){
return new ArrayList<TeamOrPersonBase>();
}
-
+
try{
return CdmStore.getService(ICommonService.class).findMatching(authorTeam, MatchStrategyConfigurator.TeamOrPersonMatchStrategy());
}catch (MatchException e) {
try {
return CdmStore.getService(ICommonService.class).findMatching(taxonNameBase, MatchStrategyConfigurator.NonViralNameMatchStrategy());
-
+
} catch (MatchException e) {
MessagingUtils.error(this.getClass(), "Error finding matching names", e);
}
protected String getTitle(Reference cdmObject) {
if(cdmObject == null){
return "";
- }else if(cdmObject.getAuthorTeam() == null){
+ }else if(cdmObject.getAuthorship() == null){
return super.getTitle(cdmObject);
}else{
- return ReferenceDefaultCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorTeam().getTitleCache());
+ return ReferenceDefaultCacheStrategy.putAuthorToEndOfString(cdmObject.getTitleCache(), cdmObject.getAuthorship().getTitleCache());
}
}
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.common.IEnumTerm;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.Identifier;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.common.Marker;
import eu.etaxonomy.cdm.model.media.MediaRepresentation;
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
import eu.etaxonomy.cdm.model.name.NameRelationship;
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataController;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataElement;
import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
import eu.etaxonomy.taxeditor.ui.openurl.OpenUrlSelectorElement;
import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationPrimerDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationPrimerDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.CurrentSampleDesignationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.PrimerGeneralDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationHistoryDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationTextDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailElement;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
return section;
}
+ public SampleDesignationDetailSection createSampleDesignationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
+ SampleDesignationDetailSection section = new SampleDesignationDetailSection(this, conversation, parentElement, selectionProvider, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public PreservedSpecimenDeterminationDetailSection createPreservedSpecimenDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, ISelectionProvider selectionProvider, int style){
PreservedSpecimenDeterminationDetailSection section = new PreservedSpecimenDeterminationDetailSection(this, conversation, parentElement, selectionProvider, style);
addAndAdaptSection(parentElement, section);
return element;
}
+ public OriginalLabelDataElement createOriginalLabelDataElement(ICdmFormElement parentElement) {
+ OriginalLabelDataElement element = new OriginalLabelDataElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
public PreservedSpecimenDetailElement createPreservedSpecimenDetailElement(ICdmFormElement parentElement) {
PreservedSpecimenDetailElement element = new PreservedSpecimenDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
}
+ public SampleDesignationDetailElement createSampleDesignationDetailElement(ICdmFormElement parentElement) {
+ SampleDesignationDetailElement element = new SampleDesignationDetailElement(this, parentElement);
+ addAndAdaptElement(parentElement, element);
+ return element;
+ }
+
/**
* @param parentElement
* @param element
return section;
}
+ public CurrentSampleDesignationDetailSection createCurrentSampleDesignationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ CurrentSampleDesignationDetailSection section = new CurrentSampleDesignationDetailSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public CurrentDeterminationDetailSection createCurrentDeterminationDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
CurrentDeterminationDetailSection section = new CurrentDeterminationDetailSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
return section;
}
+ public SampleDesignationHistoryDetailSection createSampleDesignationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
+ SampleDesignationHistoryDetailSection section = new SampleDesignationHistoryDetailSection(this, conversation, parentElement, style);
+ addAndAdaptSection(parentElement, section);
+ return section;
+ }
+
public DeterminationHistoryDetailSection createDeterminationHistoryDetailSection(ConversationHolder conversation, ICdmFormElement parentElement, int style){
DeterminationHistoryDetailSection section = new DeterminationHistoryDetailSection(this, conversation, parentElement, style);
addAndAdaptSection(parentElement, section);
if (descriptionElement.getFeature().equals(Feature.PROTOLOGUE())) {
element = new ProtologueElement(this, parentElement, descriptionElement, removeListener, style);
}
+ } else if (entity instanceof Identifier) {
+ element = new SampleDesignationTextDetailElement(this, parentElement, (Identifier<DnaSample>) entity, removeListener, backgroundColor, style);
}
if (element == null) {
return section;
}
- /**
- * @param parentElement
- * @return
- */
- public OriginalLabelDataController createOriginalLabelDataController(AbstractCdmDetailSection<DerivedUnitFacade> parentElement) {
- OriginalLabelDataElement originalLabelDataElement = new OriginalLabelDataElement(parentElement.getLayoutComposite(), SWT.NONE);
- originalLabelDataElement.initController(this, parentElement);
- return originalLabelDataElement.getController();
- }
-
}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2014 EDIT
+ * 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.element;
+
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataField;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 17.06.2014
+ *
+ */
+public class OriginalLabelDataElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private TextWithLabelElement textOriginalLabelData;
+
+ /**
+ * @param formFactory
+ * @param formElement
+ */
+ public OriginalLabelDataElement(CdmFormFactory formFactory,
+ ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement,
+ DerivedUnitFacade entity, int style) {
+ new OriginalLabelDataField(formElement.getLayoutComposite(), style, entity.innerDerivedUnit(), getFormFactory());
+// textOriginalLabelData = formFactory.createTextWithLabelElement(formElement,
+// "Original Label Data", entity.innerDerivedUnit().getOriginalLabelInfo(), SWT.MULTI);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
+ * .lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == textOriginalLabelData) {
+ getEntity().innerDerivedUnit().setOriginalLabelInfo(textOriginalLabelData.getText());
+ }
+ }
+
+}
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* 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.mvc;
-
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.mvc.interfaces.CdmCompositeController;
-import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
-
-/**
- * @author pplitzner
- * @date 17.06.2014
- *
- */
-public class OriginalLabelDataController extends AbstractCdmDetailElement<DerivedUnitFacade> implements CdmCompositeController{
-
- private final OriginalLabelDataElement originalLabelDataElement;
-
- /**
- * @param dateTimeElement
- * @param formFactory
- * @param parentElement
- * @param initialDateTime
- * @param none
- */
- public OriginalLabelDataController(CdmFormFactory formFactory, ICdmFormElement parentElement, OriginalLabelDataElement originalLabelDataElement, int style) {
- super(formFactory, parentElement);
- this.originalLabelDataElement = originalLabelDataElement;
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.element.IRelevantFormElement#setIrrelevant(boolean)
- */
- @Override
- public void setIrrelevant(boolean irrelevant) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#setEnabled(boolean)
- */
- @Override
- public void setEnabled(boolean enabled) {
- originalLabelDataElement.setEnabled(enabled);
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.element.IEnableableFormElement#isEnabled()
- */
- @Override
- public boolean isEnabled() {
- return originalLabelDataElement.isEnabled();
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, java.lang.Object, int)
- */
- @Override
- protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
- originalLabelDataElement.getText().setText(entity.getTitleCache());
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
- */
- @Override
- public void handleEvent(Object eventSource) {
- }
-}
+++ /dev/null
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* 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.mvc;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-
-/**
- * @author pplitzner
- * @date 17.06.2014
- *
- */
-public class OriginalLabelDataElement extends AbstractCdmComposite<OriginalLabelDataController>{
- private final Text text;
-
- /**
- * @param parent
- * @param style
- */
- public OriginalLabelDataElement(Composite parent, int style) {
- super(parent, style);
- {
- TableWrapLayout tableWrapLayout = new TableWrapLayout();
- tableWrapLayout.verticalSpacing = 0;
- tableWrapLayout.topMargin = 0;
- tableWrapLayout.rightMargin = 0;
- tableWrapLayout.leftMargin = 0;
- tableWrapLayout.horizontalSpacing = 0;
- tableWrapLayout.bottomMargin = 0;
- tableWrapLayout.numColumns = 3;
- setLayout(tableWrapLayout);
- }
-
- Label lblOriginalLabelData = new Label(this, SWT.NONE);
- lblOriginalLabelData.setLayoutData(new TableWrapData(TableWrapData.RIGHT, TableWrapData.TOP, 1, 1));
- lblOriginalLabelData.setText("Original Label Data");
-
- text = new Text(this, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.MULTI);
- text.setEditable(false);
- text.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
- new Label(this, SWT.NONE);
-
- // TODO Auto-generated constructor stub
- }
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.ui.mvc.AbstractCdmComposite#initInternalController(eu.etaxonomy.taxeditor.ui.element.CdmFormFactory, eu.etaxonomy.taxeditor.ui.element.ICdmFormElement)
- */
- @Override
- protected void initInternalController(CdmFormFactory formFactory, ICdmFormElement parentElement) {
- controller = new OriginalLabelDataController(formFactory, parentElement, this, SWT.NONE);
- }
-
- public Text getText() {
- return text;
- }
-}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* 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.mvc;
+
+import java.util.List;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeansObservables;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.SWTObservables;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
+
+/**
+ * @author pplitzner
+ * @date 23.06.2014
+ *
+ */
+public class OriginalLabelDataField extends Composite {
+
+ private DataBindingContext m_bindingContext;
+ private DerivedUnit derivedUnit = null;
+ private final Text originalLabelInfoText;
+ private CdmFormFactory formFactory;
+
+ public OriginalLabelDataField(Composite parent, int style, DerivedUnit newDerivedUnit, CdmFormFactory formFactory) {
+ this(parent, style);
+ setDerivedUnit(newDerivedUnit);
+ this.formFactory = formFactory;
+ }
+
+ public OriginalLabelDataField(Composite parent, int style) {
+ super(parent, style);
+ setLayout(new GridLayout(2, false));
+
+ new Label(this, SWT.NONE).setText("Original Label Data");
+
+ originalLabelInfoText = new Text(this, SWT.BORDER | SWT.WRAP | SWT.MULTI);
+ originalLabelInfoText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ if(formFactory!=null){
+ List<IPropertyChangeListener> propertyChangeListeners = formFactory.getPropertyChangeListeners();
+ for (IPropertyChangeListener iPropertyChangeListener : propertyChangeListeners) {
+ iPropertyChangeListener.propertyChange(new CdmPropertyChangeEvent(OriginalLabelDataField.this, e));
+ }
+ }
+ }
+ });
+ originalLabelInfoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ if (derivedUnit != null) {
+ m_bindingContext = initDataBindings();
+ }
+ }
+
+ @Override
+ protected void checkSubclass() {
+ // Disable the check that prevents subclassing of SWT components
+ }
+
+ private DataBindingContext initDataBindings() {
+ IObservableValue originalLabelInfoObserveWidget = SWTObservables.observeText(originalLabelInfoText, SWT.Modify);
+ IObservableValue originalLabelInfoObserveValue = BeansObservables
+ .observeValue(derivedUnit, "originalLabelInfo");
+ //
+ DataBindingContext bindingContext = new DataBindingContext();
+ //
+ bindingContext.bindValue(originalLabelInfoObserveWidget, originalLabelInfoObserveValue, null, null);
+ //
+ return bindingContext;
+ }
+
+ public DerivedUnit getDerivedUnit() {
+ return derivedUnit;
+ }
+
+ public void setDerivedUnit(DerivedUnit newDerivedUnit) {
+ setDerivedUnit(newDerivedUnit, true);
+ }
+
+ public void setDerivedUnit(DerivedUnit newDerivedUnit, boolean update) {
+ derivedUnit = newDerivedUnit;
+ if (update) {
+ if (m_bindingContext != null) {
+ m_bindingContext.dispose();
+ m_bindingContext = null;
+ }
+ if (derivedUnit != null) {
+ m_bindingContext = initDataBindings();
+ }
+ }
+ }
+
+}
// $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.
*/
* @version 1.0
*/
public class OpenUrlSelectorWizard extends Wizard {
-
- private MobotOpenUrlServiceWrapper openUrlServiceWrapper;
- private MobotOpenUrlQuery query;
-
+ private final MobotOpenUrlServiceWrapper openUrlServiceWrapper;
+
+ private final MobotOpenUrlQuery query;
+
private OpenUrlReference openUrlReference;
-
- private CdmFormFactory formFactory;
+
+ private final CdmFormFactory formFactory;
private URI openUrlReferenceImageUri;
-
- private Reference reference;
-
- private String referenceDetail;
-
-
-
+
+ private final Reference reference;
+
+ private final String referenceDetail;
+
+
+
/**
- * @param openUrlSelectorElement
+ * @param openUrlSelectorElement
* @param reference
*/
public OpenUrlSelectorWizard(Reference reference, String referenceDetail) {
if(reference == null){
throw new IllegalArgumentException("Reference may not be empty");
}
-
+
this.reference = reference;
this.referenceDetail = referenceDetail;
-
+
setWindowTitle("Mobot Open Url");
setNeedsProgressMonitor(true);
-
+
formFactory = new CdmFormFactory(Display.getDefault());
-
+
openUrlServiceWrapper = new MobotOpenUrlServiceWrapper();
openUrlServiceWrapper.setBaseUrl(PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.OPENURL_ACCESS_POINT));
-
+
query = new MobotOpenUrlQuery();
-
+
query.refType = ReferenceType.getReferenceType(reference);
- if(reference.getAuthorTeam() != null){
- query.authorName = reference.getAuthorTeam().getTitleCache();
+ if(reference.getAuthorship() != null){
+ query.authorName = reference.getAuthorship().getTitleCache();
}
query.abbreviation = reference.getTitle();
if(reference.getInReference() != null){
query.publicationPlace = reference.getPlacePublished();
query.publisherName = reference.getPublisher();
query.volume = reference.getVolume();
-
+
query.startPage = referenceDetail;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
@Override
public void addPages() {
-
+
addPage(new OpenUrlResultPage());
addPage(new OpenUrlReferencePage());
-
+
super.addPages();
}
// $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 java.util.Collection;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
int style) {
super(formFactory, conversation, parentElement, "Current Determination", style);
}
-
+
@Override
protected Control createToolbar() {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-
- Action addAction = new Action("add", Action.AS_PUSH_BUTTON){
+
+ Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
DeterminationEvent element = createNewElement();
-
+
// set as preferred determination
getEntity().setPreferredDetermination(element);
-
+
if(element != null){
- if(! getSection().isExpanded())
- getSection().setExpanded(true);
- internalUpdateSection(true);
+ if(! getSection().isExpanded()) {
+ getSection().setExpanded(true);
+ }
+ internalUpdateSection(true);
}
}
};
addAction.setImageDescriptor(new ImageDescriptor() {
-
+
@Override
public ImageData getImageData() {
return ImageResources.getImage(ImageResources.ADD_ICON).getImageData();
}
});
addAction.setToolTipText(getTooltipString());
-
+
toolBarManager.add(addAction);
-
+
return toolBarManager.createControl(this);
}
-
+
@Override
public void refresh() {
internalUpdateSection(false);
DeterminationEvent preferredDetermination = entity.getPreferredDetermination();
return preferredDetermination != null ? Arrays.asList(new DeterminationEvent[]{preferredDetermination}) : null;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.ui.section.occurrence.AbstractDeterminationEventDetailSection#createNewElement()
*/
newElement.setPreferredFlag(true);
return newElement;
}
-
+
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
private TextWithLabelElement text_accessionNumber;
private GatheringEventUnitElement element_elevation;
-
+
/**
* @param formFactory
toggleableText_titleCache = formFactory.createToggleableTextField(
formElement, "Title Cache", entity.getTitleCache(),
entity.isProtectedTitleCache(), style);
- combo_specorobstype = formFactory
- .createEnumComboElement(SpecimenOrObservationType.class,
- formElement, style);
+
+ combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
combo_specorobstype.setSelection(entity.getType());
selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(),
formElement, "Country",
entity.getExactLocation(), style);
element_elevation = formFactory.createGatheringEventUnitElement(
formElement, "Elevation : ", entity, MinMaxTextSection.UnitType.ELEVATION, style);
-
+
element_date = formFactory.createTimePeriodElement(formElement, "Date",
entity.getGatheringPeriod(), style);
selection_collector = formFactory
protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
toggleableText_titleCache = formFactory.createToggleableTextField(formElement, "Title Cache",
entity.getTitleCache(), entity.isProtectedTitleCache(), style);
+
combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
combo_specorobstype.setSelection(entity.getType());
selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(), formElement,
element_point = formFactory.createPointElement(formElement, entity.getExactLocation(), style);
element_elevation = formFactory.createGatheringEventUnitElement(
formElement, "Elevation : ", entity, MinMaxTextSection.UnitType.ELEVATION, style);
-
+
element_date = formFactory.createTimePeriodElement(formElement, "Date", entity.getGatheringPeriod(), style);
selection_collector = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement,
"Collector", entity.getCollector(), EntitySelectionElement.ALL, style);
*/
@Override
public String getHeading() {
- return "Original Label Data: ";
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.widgets.ExpandableComposite#setText(java.lang.String)
- */
- @Override
- public void setText(String title) {
- String text = getHeading();
- if(getEntity()!=null){// && getEntity().getOriginalLabelData!=null){
- String titleCache = getEntity().getTitleCache();
- text += titleCache.substring(0, Math.min(10, titleCache.length()));
- text += "...";
- }
- if(text!=null){
- super.setText(text);
- }
- else{
- super.setText(title);
- }
+ return "Original Label Data";
}
/* (non-Javadoc)
*/
@Override
protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
- return formFactory.createOriginalLabelDataController(parentElement);
+ return formFactory.createOriginalLabelDataElement(parentElement);
}
}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.dna;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
+
+/**
+ *
+ * @author pplitzner
+ * @date Oct 16, 2014
+ *
+ */
+public abstract class AbstractSampleDesignationDetailSection extends
+ AbstractEntityCollectionSection<DnaSample, Identifier<DnaSample>> {
+
+ public AbstractSampleDesignationDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ String title, int style) {
+ super(formFactory, conversation, parentElement, title, style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Identifier<DnaSample> createNewElement() {
+ Identifier identifier = getEntity().addIdentifier(null, DerivateLabelProvider.getSampleDesignationTerm());
+ return identifier;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(Identifier<DnaSample> sampleDesignation) {
+ getEntity().addIdentifier(sampleDesignation);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(Identifier<DnaSample> sampleDesignation) {
+ getEntity().removeIdentifier(sampleDesignation);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public String getEmptyString() {
+ return "No sample designations yet.";
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.dna;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.widgets.Control;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.model.ImageResources;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
+
+/**
+ *
+ * @author pplitzner
+ * @date Oct 16, 2014
+ *
+ */
+public class CurrentSampleDesignationDetailSection extends AbstractSampleDesignationDetailSection {
+
+ public CurrentSampleDesignationDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ int style) {
+ super(formFactory, conversation, parentElement, "Current Sample Designation", style);
+ }
+
+ @Override
+ protected Control createToolbar() {
+ ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
+
+ Action addAction = new Action("add", IAction.AS_PUSH_BUTTON){
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ Identifier<DnaSample> element = createNewElement();
+
+ getEntity().addIdentifier(element);
+
+ if(element != null){
+ if(! getSection().isExpanded()) {
+ getSection().setExpanded(true);
+ }
+ internalUpdateSection(true);
+ }
+ }
+ };
+ addAction.setImageDescriptor(new ImageDescriptor() {
+
+ @Override
+ public ImageData getImageData() {
+ return ImageResources.getImage(ImageResources.ADD_ICON).getImageData();
+ }
+ });
+ addAction.setToolTipText(getTooltipString());
+
+ toolBarManager.add(addAction);
+
+ return toolBarManager.createControl(this);
+ }
+
+ @Override
+ public void refresh() {
+ internalUpdateSection(false);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
+ */
+ @Override
+ public Collection<Identifier<DnaSample>> getCollection(DnaSample entity) {
+ LinkedList<Identifier<DnaSample>> sampleDesignations = new LinkedList<Identifier<DnaSample>>();
+ for (Identifier<DnaSample> identifier : entity.getIdentifiers()) {
+ if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
+ sampleDesignations.add(identifier);
+ }
+ }
+ Collections.reverse(sampleDesignations);
+ if(sampleDesignations.size()>0){
+ //last sample designation is the current
+ return Collections.singleton(sampleDesignations.getFirst());
+ }
+ else{
+ return Collections.emptyList();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Create new current sample designation";
+ }
+
+}
*/
public class DnaSampleGeneralDetailElement extends AbstractCdmDetailElement<DnaSample> {
-
private TimePeriodElement datePreservationDate;
private EntitySelectionElement<AgentBase> selectionPreparedBy;
private NumberWithLabelElement numberPreservationTemperature;
@Override
protected void createControls(ICdmFormElement formElement, DnaSample entity, int style) {
TimePeriod timePeriod = null;
- AgentBase actor = null;
+ AgentBase<?> actor = null;
Double temperature = null;
DefinedTerm definedMaterialOrMethod = null;
if(entity.getPreservation()!=null){
definedMaterialOrMethod = entity.getPreservation().getDefinedMaterialOrMethod();
}
datePreservationDate = formFactory.createTimePeriodElement(formElement, "Preservation date", timePeriod, style);
- // TODO sample designation
selectionPreparedBy = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared by", actor, EntitySelectionElement.ALL, style);
numberPreservationTemperature = formFactory.createNumberTextWithLabelElement(formElement, "Preservation Temp. [C°]", temperature, style);
comboMaterialOrMethods = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Materials & Methods", definedMaterialOrMethod, style);
//TODO preparation date
//TODO sample type
textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
+
}
/*
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.dna;
+
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ *
+ * @author pplitzner
+ * @date Oct 20, 2014
+ *
+ */
+public class SampleDesignationDetailElement extends AbstractCdmDetailElement<DnaSample> {
+
+ private CurrentSampleDesignationDetailSection sectionCurrentSampleDesignation;
+
+ private SampleDesignationHistoryDetailSection sectionSampleDesignationHistory;
+
+ /**
+ * @param formFactory
+ * @param formElement
+ */
+ public SampleDesignationDetailElement(CdmFormFactory formFactory,
+ ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#createControls(eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement,
+ DnaSample entity, int style) {
+
+ sectionCurrentSampleDesignation = formFactory.createCurrentSampleDesignationDetailSection(getConversationHolder(), formElement, ExpandableComposite.EXPANDED);
+ sectionCurrentSampleDesignation.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ sectionCurrentSampleDesignation.setEntity(entity);
+
+ sectionSampleDesignationHistory = formFactory.createSampleDesignationHistoryDetailSection(getConversationHolder(), formElement, ExpandableComposite.TWISTIE);
+ sectionSampleDesignationHistory.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
+ sectionSampleDesignationHistory.setEntity(entity);
+
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement#handleEvent(java.lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource == sectionCurrentSampleDesignation){
+ sectionSampleDesignationHistory.refresh();
+ }
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.dna;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+
+/**
+ * @author n.hoffmann
+ * @created May 11, 2011
+ * @version 1.0
+ */
+public class SampleDesignationDetailSection extends AbstractCdmDetailSection<DnaSample> {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param parentElement
+ * @param selectionProvider
+ * @param style
+ */
+ public SampleDesignationDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#getHeading()
+ */
+ @Override
+ public String getHeading() {
+ return "Sample Designations";
+ }
+
+ @Override
+ protected void setSectionTitle() {
+ this.setText(getHeading());
+ setTextClient(createToolbar());
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+ */
+ @Override
+ protected AbstractCdmDetailElement<DnaSample> createCdmDetailElement(AbstractCdmDetailSection<DnaSample> parentElement, int style) {
+ return formFactory.createSampleDesignationDetailElement(parentElement);
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* 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.dna;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
+
+/**
+ * @author n.hoffmann
+ * @created May 11, 2011
+ * @version 1.0
+ */
+public class SampleDesignationHistoryDetailSection extends AbstractSampleDesignationDetailSection {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param parentElement
+ * @param style
+ */
+ public SampleDesignationHistoryDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ int style) {
+ super(formFactory, conversation, parentElement, "Sample Designation History", style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
+ */
+ @Override
+ public Collection<Identifier<DnaSample>> getCollection(DnaSample entity) {
+ LinkedList<Identifier<DnaSample>> sampleDesignations = new LinkedList<Identifier<DnaSample>>();
+ for (Identifier<DnaSample> identifier : entity.getIdentifiers()) {
+ if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
+ sampleDesignations.add(identifier);
+ }
+ }
+ Collections.reverse(sampleDesignations);
+ if(sampleDesignations.size()>0){
+ sampleDesignations.removeFirst();//last is the current sample designation
+ }
+ return sampleDesignations;
+ }
+
+ @Override
+ public void refresh() {
+ internalUpdateSection(false);
+ }
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Add a sample designation to the history";
+ }
+
+}
--- /dev/null
+// $Id$
+/**
+ * Copyright (C) 2007 EDIT
+ * 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.dna;
+
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+
+import eu.etaxonomy.cdm.model.common.Identifier;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+
+/**
+ *
+ * @author pplitzner
+ * @date Oct 16, 2014
+ *
+ * @param <T>
+ */
+public class SampleDesignationTextDetailElement extends
+ AbstractEntityCollectionElement<Identifier<DnaSample>> {
+
+ protected TextWithLabelElement text_description;
+
+ /**
+ * @param formFactory
+ * @param section
+ * @param entity
+ * @param removeListener
+ * @param backgroundColor
+ * @param style
+ */
+ public SampleDesignationTextDetailElement(CdmFormFactory formFactory, AbstractFormSection<?> section,
+ Identifier<DnaSample> entity, SelectionListener removeListener, Color backgroundColor, int style) {
+ super(formFactory, section, entity, removeListener, backgroundColor, style);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, int)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void createControls(ICdmFormElement element, int style) {
+ text_description = formFactory.createTextWithLabelElement(element,
+ "Sample Designation", null, style);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if(eventSource==text_description){
+ this.entity.setIdentifier(text_description.getText());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement#setEntity(java.lang.Object)
+ */
+ @Override
+ public void setEntity(Identifier<DnaSample> entity) {
+ this.entity = entity;
+ text_description.setText(entity.getIdentifier());
+ }
+
+}
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
+import org.eclipse.swt.widgets.Text;
+
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.molecular.Sequence;
private NumberWithLabelElement textConsensusSequenceLength;
private TextWithLabelElement textBarcodeSequence;
private TextWithLabelElement textGeneticAccessNo;
+ private UriWithLabelElement textNCBIUri;
+ private UriWithLabelElement textENAUri;
+ private UriWithLabelElement textDDBJUri;
private TextWithLabelElement textBoldProcessID;
private UriWithLabelElement textBoldUri;
@Override
protected void createControls(ICdmFormElement formElement, Sequence entity, int style) {
comboMarker = formFactory.createDefinedTermComboElement(TermType.DnaMarker, formElement, "DNA Marker", entity.getDnaMarker(), style);
- textConsensusSequence = formFactory.createTextWithLabelElement(formElement, "Consensus Sequence 5'->3'", entity.getConsensusSequence().getString(), style);
- textConsensusSequenceLength = formFactory.createNumberTextWithLabelElement(formElement, "Consensus Seq. Length", entity.getConsensusSequence().getLength(), style);
- textConsensusSequenceLength.setEnabled(false);
+// textConsensusSequence = formFactory.createTextWithLabelElement(formElement, "Consensus Sequence 5'->3'", entity.getConsensusSequence().getString(), style);
+// textConsensusSequenceLength = formFactory.createNumberTextWithLabelElement(formElement, "Consensus Seq. Length", entity.getConsensusSequence().getLength(), style);
+// ((Text) textConsensusSequenceLength.getMainControl()).setEditable(false);
textBarcodeSequence = formFactory.createTextWithLabelElement(formElement, "Barcode Sequence 5'->3'", entity.getBarcodeSequencePart()==null?"":entity.getBarcodeSequencePart().getString(), style);
textGeneticAccessNo = formFactory.createTextWithLabelElement(formElement, "Genetic Acc. No.", entity.getGeneticAccessionNumber(), style);
+ textNCBIUri = formFactory.createUriWithLabelElement(formElement, "NCBI URI", entity.getGenBankUri(), style);
+ ((Text) textNCBIUri.getMainControl()).setEditable(false);
+ textENAUri = formFactory.createUriWithLabelElement(formElement, "ENA URI", entity.getEmblUri(), style);
+ ((Text) textENAUri.getMainControl()).setEditable(false);
+ textDDBJUri = formFactory.createUriWithLabelElement(formElement, "DDBJ URI", entity.getDdbjUri(), style);
+ ((Text) textDDBJUri.getMainControl()).setEditable(false);
textBoldProcessID = formFactory.createTextWithLabelElement(formElement, "BOLD Process ID", entity.getBoldProcessId(), style);
textBoldUri = formFactory.createUriWithLabelElement(formElement, "BOLD URI", entity.getBoldUri(), style);
- textBoldUri.setEnabled(false);
-
+ ((Text) textBoldUri.getMainControl()).setEditable(false);
+ ((Text) textBoldUri.getMainControl()).setToolTipText("Query BOLD");
}
/*
getEntity().setConsensusSequence(consensusSequence);
textConsensusSequenceLength.setNumber(consensusSequence.getLength());
}
- else if(eventSource==textConsensusSequenceLength){
- // this is a derived value and should not be edited
- }
else if(eventSource==textBarcodeSequence){
SequenceString barcodeSequencePart = getEntity().getBarcodeSequencePart();
if(barcodeSequencePart==null){
}
else if(eventSource==textGeneticAccessNo){
getEntity().setGeneticAccessionNumber(textGeneticAccessNo.getText());
+ if(textGeneticAccessNo.getText()!=null && !textGeneticAccessNo.getText().isEmpty()){
+ textNCBIUri.setUri(getEntity().getGenBankUri());
+ textENAUri.setUri(getEntity().getEmblUri());
+ textDDBJUri.setUri(getEntity().getDdbjUri());
+ }
+ else{
+ textNCBIUri.setText("");
+ textENAUri.setText("");
+ textDDBJUri.setText("");
+ }
}
else if(eventSource==textBoldProcessID){
getEntity().setBoldProcessId(textBoldProcessID.getText());
textBoldUri.setText("");
}
}
- else if(eventSource==textBoldUri){
- //cannot be set because it is generated from the genetic access number and a base URI
- }
}
}
selection_authorTeam = formFactory
.createSelectionElement(AgentBase.class,
getConversationHolder(), formElement, "Author",
- AuthorHelper.getAuthor(entity.getAuthorTeam()),
+ AuthorHelper.getAuthor(entity.getAuthorship()),
EntitySelectionElement.ALL, style);
ReferenceType referenceType = entity.getType();
}
// selections
else if (eventSource == selection_authorTeam) {
- getEntity().setAuthorTeam(
+ getEntity().setAuthorship(
(TeamOrPersonBase) selection_authorTeam.getSelection());
} else if (eventSource == selection_inReference) {
getEntity().setInReference(selection_inReference.getSelection());
import eu.etaxonomy.cdm.model.molecular.DnaSample;
import eu.etaxonomy.cdm.model.molecular.Sequence;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
-import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent;
private static DefinedTerm drawingTerm = null;
private static DefinedTerm specimenScanTerm = null;
private static DefinedTerm detailImageTerm = null;
+ private static DefinedTerm sampleDesignationTerm = null;
private static void initializeTerms() {
List<DefinedTerm> preferredTerms = CdmStore.getTermManager().getPreferredTerms(DefinedTerm.class);
else if(definedTerm.getUuid().equals(UUID.fromString("31eb8d02-bf5d-437c-bcc6-87a626445f34"))){
detailImageTerm = definedTerm;
}
+ else if(definedTerm.getUuid().equals(UUID.fromString("fadeba12-1be3-4bc7-9ff5-361b088d86fc"))){
+ sampleDesignationTerm = definedTerm;
+ }
}
}
return detailImageTerm;
}
+ public static DefinedTerm getSampleDesignationTerm(){
+ if(sampleDesignationTerm==null){
+ initializeTerms();
+ }
+ return sampleDesignationTerm;
+ }
+
/** {@inheritDoc} */
@Override
* @return
*/
public String getDerivateText(Object element){
+ TreeNode parentNode = null;
if(element instanceof TreeNode){
+ parentNode = ((TreeNode) element).getParent();
//unwrap specimen from TreeNode
element = ((TreeNode) element).getValue();
}
label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
}
- label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+", ":"";
- Collection collection = mediaSpecimen.getCollection();
+ eu.etaxonomy.cdm.model.occurrence.Collection collection = mediaSpecimen.getCollection();
if(collection!=null){
label += collection.getName()!=null?collection.getName()+" ":"";
+ label += collection.getCode()!=null?"("+collection.getCode()+"), ":"";
}
+ label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+", ":"";
}
else if(element instanceof DnaSample
|| (element instanceof DerivedUnit
&& ((SpecimenOrObservationBase<?>) element).getRecordBasis()==SpecimenOrObservationType.DnaSample)){
- //TODO implement
- label += element.toString();
+ DerivedUnit derivedUnit = (DerivedUnit)element;
+ Set<String> identifiers = derivedUnit.getIdentifiers(getSampleDesignationTerm());
+ if(identifiers.isEmpty()){
+ label += "[no sample designation]";
+ }
+ else{
+ String identifier = identifiers.iterator().next();
+ label += identifier==null?"":identifier;
+ }
}
else if(element instanceof DerivedUnit){
if(fieldUnits!=null && !fieldUnits.isEmpty()){
FieldUnit fieldUnit = fieldUnits.iterator().next();
GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
+// gatheringEvent = HibernateProxyHelper.deproxy(gatheringEvent, GatheringEvent.class);
if(gatheringEvent!=null){
label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+", ":"";
}
label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+", ":"";
}
- Collection collection = derivedUnit.getCollection();
+ eu.etaxonomy.cdm.model.occurrence.Collection collection = derivedUnit.getCollection();
if(collection!=null){
label += collection.getName()!=null?collection.getName()+" ":"";
label += collection.getCode()!=null?"("+collection.getCode()+"), ":"";
}
else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
//TODO: implement
-// kindofTissue + SampleDesignation
+ label += "kindofTissue? + [no sample designation]";
}
}
else if(element instanceof Sequence){
Sequence sequence = (Sequence)element;
- label += "SampleDesignation?"+", ";
+ label += "[no sample designation]"+", ";
label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():"";
}
else if(element instanceof SingleRead){
SingleRead singleRead = (SingleRead)element;
+ label += "[no sample designation]"+", ";
label += singleRead.getPrimer()!=null?singleRead.getPrimer().getLabel()+", ":"";
- label += "Marker?";
+ if(parentNode!=null && parentNode.getValue() instanceof Sequence){
+ Sequence sequence = (Sequence) parentNode.getValue();
+ label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():"";
+ }
}
else if(element instanceof SpecimenOrObservationBase){
SpecimenOrObservationBase<?> derivate = (SpecimenOrObservationBase<?>) element;
private final DerivateSearchComposite derivateSearchComposite;
private IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>> configurator;
private EnumTermComboController<SpecimenOrObservationType> enumTermComboController;
- private DerivateLabelProvider labelProvider;
-
+ private final DerivateSearchView derivateSearchView;
+ private DerivateLabelProvider labelProvider;
/**
* @param parent
+ * @param derivateSearchView
*/
- public DerivateSearchCompositeController(Composite parent) {
+ public DerivateSearchCompositeController(Composite parent, DerivateSearchView derivateSearchView) {
this.derivateSearchComposite = new DerivateSearchComposite(parent, SWT.NONE);
+ this.derivateSearchView = derivateSearchView;
init();
}
}
private void searchDerivates(){
+ if(!derivateSearchView.getConversationHolder().isBound()){
+ derivateSearchView.setFocus(); //rebind the conversation
+ }
+
configurator.setTitleSearchString(derivateSearchComposite.getSearchField().getText());
SpecimenOrObservationType type = enumTermComboController.getSelection();
//filter by specimen type
public void reset(){
derivateSearchComposite.getResultViewer().setInput(null);
derivateSearchComposite.getSearchField().setText("");
+ enumTermComboController.setSelection(SpecimenOrObservationType.Unknown);
derivateSearchComposite.getComboDerivateType().deselectAll();
}
*/
@Override
public void createPartControl(Composite parent) {
- derivateSearchCompositeController = new DerivateSearchCompositeController(parent);
+ derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
getSite().setSelectionProvider(derivateSearchCompositeController.getResultViewer());
derivateSearchCompositeController.setEnabled(CdmStore.isActive());
}
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.SectionPart;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
if (event != null) {
Object eventSource = event.getSource();
+ Control[] children = formSection.getLayoutComposite().getChildren();
+ boolean containsElement = false;
+ for (Control control : children) {
+ if(eventSource.equals(control)){
+ containsElement = true;
+ break;
+ }
+ }
+ if(containsElement){
+ markDirty();
+ }
- if (formSection.equals(eventSource)){
+ else if (formSection.equals(eventSource)){
markDirty();
}
- if((
- (eventSource instanceof ICdmFormElement)
- && formSection.containsFormElement((ICdmFormElement) eventSource))
- ) {
- markDirty();
+ else if(((eventSource instanceof ICdmFormElement)&& formSection.containsFormElement((ICdmFormElement) eventSource))) {
+ markDirty();
}
}
}
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AmplificationPrimerDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaQualityDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.DnaSampleGeneralDetailSection;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SampleDesignationDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceContigFileCollectionDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceGeneralDetailSection;
import eu.etaxonomy.taxeditor.ui.section.occurrence.dna.SequenceReferenceCollectionDetailSection;
DnaQualityDetailSection qualitySection = formFactory.createDnaQualityDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
+ formFactory.createHorizontalSeparator(parent, SWT.BORDER);
+
+ SampleDesignationDetailSection sampleDesignationDetailSection = formFactory.createSampleDesignationDetailSection(getConversationHolder(), parent, this, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED);
+
addPart(section);
addPart(qualitySection);
+ addPart(sampleDesignationDetailSection);
}
private void createAmplificationSection(RootElement parent) {
Bundle-ManifestVersion: 2
Bundle-Name: eu.etaxonomy.taxeditor.test
Bundle-SymbolicName: eu.etaxonomy.taxeditor.test;singleton:=true
-Bundle-Version: 3.0.10.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-Vendor: EDIT
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
<parent>\r
<groupId>eu.etaxonomy</groupId>\r
<artifactId>taxeditor-parent</artifactId>\r
- <version>3.0.12-SNAPSHOT</version>\r
+ <version>3.4.0-SNAPSHOT</version>\r
</parent>\r
<modelVersion>4.0.0</modelVersion>\r
<artifactId>eu.etaxonomy.taxeditor.test</artifactId>\r
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
-<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="3.3.8.qualifier" useFeatures="true" includeLaunchers="true">
+<product name="EDIT Taxonomic Editor" uid="eu.etaxonomy.taxeditor.product" id="eu.etaxonomy.taxeditor.application.eu_etaxonomy_taxeditor_product" application="eu.etaxonomy.taxeditor.application.application" version="3.4.0.qualifier" useFeatures="true" includeLaunchers="true">
<aboutInfo>
<image path="/eu.etaxonomy.taxeditor.application/icons/256color_48x48.gif"/>
<vm>
</vm>
- <!--license>
- <url>http://www.mozilla.org/MPL/</url>
- <text>
- The contents of this file are subject to the Mozilla Public License Version 1.1 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at
-http://www.mozilla.org/MPL/
-
-Software distributed under the License is distributed on an &quot;AS IS&quot; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
- </text>
- </license -->
-
<plugins>
</plugins>
<parent>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
</prerequisites>
<groupId>eu.etaxonomy</groupId>
<artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
+ <version>3.4.0-SNAPSHOT</version>
<name>EDIT Taxonomic Editor</name>
<description>The Taxonomic Editor for EDIT's platform for
cybertaxonomy</description>
<properties>
<java.codelevel>1.6</java.codelevel>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <cdmlib.version>3.3.8-SNAPSHOT</cdmlib.version>
+ <cdmlib.version>3.4.0-SNAPSHOT</cdmlib.version>
<!-- TODO can we use project.version ????? -->
<tycho.version>0.14.0</tycho.version>
- <taxeditor.version>3.3.8-SNAPSHOT</taxeditor.version>
+ <taxeditor.version>3.4.0-SNAPSHOT</taxeditor.version>
<update.dir>snapshot</update.dir>
</properties>
<modules>