eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/DerivateViewContextMenu.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/SingleReadSequenceContextMenu.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/handler/DeleteDerivateHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/operation/DeleteDerivateOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDragListener.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementTransfer.java -text
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>
<equals
value="eu.etaxonomy.taxeditor.editor.view.media">
</equals>
- <equals
- value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
- </equals>
</or>
</with>
</activeWhen>
class="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler">
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
+ commandId="org.eclipse.ui.edit.delete">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
</extension>
<extension
name="%extension.name"
<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 eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
public class DerivateContentProvider implements ITreeContentProvider {
value = ((TreeNode) element).getValue();
}
Set<Object> children = new LinkedHashSet<Object>();
- if(value instanceof DnaSample){
+ if(value instanceof DnaSample && ((DnaSample) value).getRecordBasis()==SpecimenOrObservationType.DnaSample){
DnaSample dnaSample = (DnaSample)value;
Set<Sequence> sequences = dnaSample.getSequences();
for (Sequence sequence : sequences) {
element = ((TreeNode) element).getValue();
}
- if(element instanceof DnaSample){
+ if(element instanceof DnaSample && ((DnaSample) element).getRecordBasis()==SpecimenOrObservationType.DnaSample){
DnaSample dnaSample = (DnaSample)element;
if(!dnaSample.getSequences().isEmpty()){// || !dnaSample.getAmplifications().isEmpty()){
return true;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
TreeNode fromParentNode = draggedNode.getParent();
Object fromParentSpecimen = null;
if(fromParentNode!=null){
- fromParentNode.getValue();
+ fromParentSpecimen = fromParentNode.getValue();
}
// drag'n'drop for SpecimenOrObservationBase
DerivedUnit draggedSpecimen = (DerivedUnit) draggedNodeValue;
SpecimenOrObservationBase<?> targetSpecimen = (SpecimenOrObservationBase<?>) targetNodeValue;
//check if type is a sub derivate type
- if(!fromParentNode.equals(targetNode)//don't drag on direct parent node
- && fromParentSpecimen instanceof SpecimenOrObservationBase<?>){
+ if(fromParentSpecimen instanceof SpecimenOrObservationBase<?>
+ && fromParentNode!=null
+ && !fromParentNode.equals(targetNode)){//don't drag on direct parent node)
return occurrenceService.moveDerivate((SpecimenOrObservationBase<?>)fromParentSpecimen, targetSpecimen, draggedSpecimen);
}
}
}
// drag'n'drop for Sequence
- else if(draggedNodeValue instanceof Sequence && targetNodeValue instanceof DnaSample ){
+ else if(draggedNodeValue instanceof Sequence && targetNodeValue instanceof DnaSample && ((SpecimenOrObservationBase<?>) targetNodeValue).getRecordBasis()==SpecimenOrObservationType.DnaSample){
Sequence sequence = (Sequence)draggedNodeValue;
if(fromParentSpecimen instanceof DnaSample){
return occurrenceService.moveSequence((DnaSample)fromParentSpecimen, (DnaSample)targetNodeValue, sequence);
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)
*/
if(selectedTreeNode.getValue() instanceof FieldUnit){
createMenuItem(addMenu, "Specimen", selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen);
new MenuItem(addMenu, SWT.SEPARATOR);
- createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.TissueSample);
+ createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample);
createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample);
createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media);
}
//context menu for Specimen
else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
- createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DerivedUnit.class, SpecimenOrObservationType.TissueSample);
+ createMenuItem(addMenu, "Tissue Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.TissueSample);
createMenuItem(addMenu, "DNA Sample", selectedTreeNode, DnaSample.class, SpecimenOrObservationType.DnaSample);
createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media);
}
//context menu for TissueSample
- else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
+ else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)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){
+ else if(selectedTreeNode.getValue() instanceof DnaSample && ((DnaSample)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.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){
+ if(selectedDerivate instanceof DnaSample && ((DnaSample) selectedDerivate).getRecordBasis()==SpecimenOrObservationType.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;
DerivedUnit derivedUnit;
if(childClass.equals(DnaSample.class)){
derivedUnit = DnaSample.NewInstance();
+ if(specimenType==SpecimenOrObservationType.DnaSample){
+ derivedUnit.setRecordBasis(SpecimenOrObservationType.DnaSample);
+ }
+ else if(specimenType==SpecimenOrObservationType.TissueSample){
+ derivedUnit.setRecordBasis(SpecimenOrObservationType.TissueSample);
+ }
}
else if(childClass.equals(MediaSpecimen.class)){
derivedUnit = MediaSpecimen.NewInstance(specimenType);
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);
}
}
}
--- /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.editor.view.derivate.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.view.derivate.operation.DeleteDerivateOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ *
+ * @author pplitzner
+ * @date Oct 21, 2014
+ *
+ */
+public class DeleteDerivateHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getActiveSite(event).getSelectionProvider().getSelection();
+
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
+
+ try {
+ String label = event.getCommand().getName();
+
+ IUndoContext undoContext = EditorUtil.getUndoContext();
+
+ if(selection.size()>0){
+ Object object = selection.iterator().next();
+
+ if(object instanceof TreeNode){
+ TreeNode treeNode = (TreeNode)object;
+ Object value = ((TreeNode) object).getValue();
+ if(value instanceof SpecimenOrObservationBase<?> || value instanceof Sequence || value instanceof SingleRead){
+ DeleteDerivateOperation deleteDerivateOperation = new DeleteDerivateOperation(label, undoContext, (CdmBase) object, postOperationEnabled);
+ AbstractUtility.executeOperation(deleteDerivateOperation);
+ }
+ }
+ else{
+ MessagingUtils.error(getClass(), "Selection is not valid for this delete handler", null);
+ }
+ }
+
+ } catch (NotDefinedException e) {
+ MessagingUtils.warn(getClass(), "Command name not set.");
+ }
+ return null;
+ }
+}
--- /dev/null
+/**
+ * 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.editor.view.derivate.operation;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
+import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
+
+/**
+ *
+ * @author pplitzner
+ * @date Oct 21, 2014
+ *
+ */
+public class DeleteDerivateOperation extends AbstractPostOperation<CdmBase> {
+
+ public DeleteDerivateOperation(String label, IUndoContext undoContext, CdmBase element,
+ IPostOperationEnabled postOperationEnabled) {
+ super(label, undoContext, element, postOperationEnabled);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse
+ * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return postExecute(null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse
+ * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return execute(monitor, info);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse
+ * .core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return postExecute(element);
+ }
+}
<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 org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.internal.forms.widgets.FormFonts;
+import org.joda.time.DateTime;
import org.joda.time.Partial;
import org.springframework.security.core.GrantedAuthority;
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.mvc.element.DateElement;
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 labelElement;
}
+ public DateElement createDateElement(ICdmFormElement formElement, String labelText, DateTime dateTime, int style){
+ Label label = new Label(formElement.getLayoutComposite(), style);
+ label.setText(labelText+" (yyyy-MM-dd)");
+ DateElement dateElement = new DateElement(formElement.getLayoutComposite(), dateTime, style);
+ dateElement.initController(this, formElement);
+ return dateElement;
+ }
+
/**
* <p>
* Getter for the field <code>selectionProvider</code>.
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();
+ }
+ }
+ }
+
+}
setLayout(tableWrapLayout);
}
- textDate = new Text(this, SWT.BORDER);
+ textDate = new Text(this, SWT.BORDER | SWT.WRAP);
textDate.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
toolkit.adapt(textDate, true, true);
}
// $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.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.Identifier;
+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<IdentifiableEntity<?>, Identifier> {
+
+ 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 createNewElement() {
+ Identifier identifier = getEntity().addIdentifier(null, DerivateLabelProvider.getSampleDesignationTerm());
+ return identifier;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void removeElement(Identifier 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 eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.Identifier;
+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
+ public void refresh() {
+ internalUpdateSection(false);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
+ */
+ @Override
+ public Collection<Identifier> getCollection(IdentifiableEntity<?> entity) {
+ Identifier currentSampleDesignation = DerivateLabelProvider.getCurrentSampleDesignation(entity);
+ if(currentSampleDesignation!=null){
+ return Collections.singleton(currentSampleDesignation);
+ }
+ else{
+ return Collections.emptyList();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected String getTooltipString() {
+ return "Create new current sample designation";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(Identifier sampleDesignation) {
+ //The current sample designation is always the first one found.
+ //The following are recent sample designations with the most recent being
+ //the second one found and so on
+ getEntity().addIdentifier(0, sampleDesignation);
+ }
+
+}
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
+import org.joda.time.DateTime;
+
+import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.molecular.DnaQuality;
import eu.etaxonomy.cdm.model.molecular.DnaSample;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.mvc.element.DateElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
/**
*/
public class DnaQualityDetailElement extends AbstractCdmDetailElement<DnaSample> {
+// private final TermType qualityTermVocabulary = CdmStore.getService(IVocabularyService.class).find(VocabularyEnum.DnaQualityTerm.getUuid());
+
+ private TextWithLabelElement textPurificationMethod;
+ private NumberWithLabelElement numberRatioOfAbsorbance260_280;
+ private NumberWithLabelElement numberRatioOfAbsorbance260_230;
+ private NumberWithLabelElement numberConcentration;
+ private TermComboElement<DefinedTerm> comboQualityTerm;
+ private DateElement dateQualityCheck;
+
/**
* @param formFactory
* @param formElement
*/
@Override
protected void createControls(ICdmFormElement formElement, DnaSample entity, int style) {
- //TODO DNA purification details
- //TODO Ratio of absorbance 260-280
- //TODO Ratio of absorbance 260-230
- //TODO concentration unit
- //TODO concentration
- //TODO DNA quality
- //TODO Quality check date
- //TODO Descritpion
+ DnaQuality dnaQuality = entity.getDnaQuality();
+ if(dnaQuality==null){
+ dnaQuality = DnaQuality.NewInstance();
+ }
+ Double ratioOfAbsorbance260_230 = dnaQuality.getRatioOfAbsorbance260_230();
+ Double ratioOfAbsorbance260_280 = dnaQuality.getRatioOfAbsorbance260_280();
+ Double concentration = dnaQuality.getConcentration();
+ DefinedTerm qualityTerm = dnaQuality.getQualityTerm();
+
+// textPurificationMethod = formFactory.createTextWithLabelElement(formElement, "Purification Method", dnaQuality.getPurificationMethod(), style);
+ numberRatioOfAbsorbance260_280 = formFactory.createNumberTextWithLabelElement(formElement, "Ratio of absorbance 260-280", ratioOfAbsorbance260_280, style);
+ numberRatioOfAbsorbance260_230 = formFactory.createNumberTextWithLabelElement(formElement, "Ratio of absorbance 260-230", ratioOfAbsorbance260_230, style);
+ numberConcentration = formFactory.createNumberTextWithLabelElement(formElement, "Concentration", concentration, style);
+// comboQualityTerm = formFactory.createDefinedTermComboElement(qualityTermVocabulary, formElement, "Quality Term", qualityTerm, style);
+ dateQualityCheck = formFactory.createDateElement(formElement, "Quality Check", dnaQuality.getQualityCheckDate(), style);
}
/*
*/
@Override
public void handleEvent(Object eventSource) {
+ DnaQuality dnaQuality = getEntity().getDnaQuality();
+ if(eventSource==textPurificationMethod){
+ //TODO
+// dnaQuality.setPurificationMethod(textPurificationMethod.getText());
+ }
+ else if(eventSource==numberRatioOfAbsorbance260_230){
+ dnaQuality.setRatioOfAbsorbance260_230(numberRatioOfAbsorbance260_230.getDouble());
+ }
+ else if(eventSource==numberRatioOfAbsorbance260_280){
+ dnaQuality.setRatioOfAbsorbance260_280(numberRatioOfAbsorbance260_280.getDouble());
+ }
+ else if(eventSource==numberConcentration){
+ dnaQuality.setConcentration(numberConcentration.getDouble());
+ }
+ else if(eventSource==comboQualityTerm){
+ dnaQuality.setQualityTerm(comboQualityTerm.getSelection());
+ }
+ else if(eventSource==dateQualityCheck.getController()){
+ DateTime dateTime = dateQualityCheck.getController().getDateTime();
+ dnaQuality.setQualityCheckDate(dateTime);
+ }
}
}
*/
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);
+
}
/*
package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
import eu.etaxonomy.cdm.model.molecular.Primer;
-import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SequenceString;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
textPrimerName = formFactory.createTextWithLabelElement(formElement, "Primer Name", entity.getLabel(), style);
String sequenceString = "";
if(entity.getSequence()!=null){
- sequenceString = entity.getSequence().getSequenceString();
+ sequenceString = entity.getSequence().getString();
}
textPrimerSequence = formFactory.createTextWithLabelElement(formElement, "Primer seq. 5'->3'", sequenceString, style);
getEntity().setLabel(textPrimerName.getText());
}
else if(eventSource==textPrimerSequence){
- Sequence sequence = getEntity().getSequence();
- if(sequence==null){
- sequence = Sequence.NewInstance("");
- getEntity().setSequence(sequence);
+ SequenceString sequenceString = getEntity().getSequence();
+ if(sequenceString==null){
+ sequenceString = SequenceString.NewInstance("");
+ getEntity().setSequence(sequenceString);
}
- sequence.setSequenceString(textPrimerSequence.getText());
+ sequenceString.setString(textPrimerSequence.getText());
}
else if(eventSource==selectionReference){
getEntity().setPublishedIn(selectionReference.getSelection());
--- /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.common.IdentifiableEntity;
+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<IdentifiableEntity<?>> {
+
+ 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,
+ IdentifiableEntity<?> 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.common.IdentifiableEntity;
+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<IdentifiableEntity<?>> {
+
+ /**
+ * @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<IdentifiableEntity<?>> createCdmDetailElement(AbstractCdmDetailSection<IdentifiableEntity<?>> 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.LinkedList;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.Identifier;
+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> getCollection(IdentifiableEntity<?> entity) {
+ LinkedList<Identifier> sampleDesignations = new LinkedList<Identifier>();
+ for (Identifier identifier : entity.getIdentifiers()) {
+ if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
+ sampleDesignations.add(identifier);
+ }
+ }
+ if(sampleDesignations.size()>0){
+ sampleDesignations.removeFirst();//first 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";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public void addElement(Identifier sampleDesignation) {
+ //The current sample designation is always the first one found.
+ //The following are recent sample designations with the most recent being
+ //the second one found and so on
+ Identifier currentSampleDesignation = DerivateLabelProvider.getCurrentSampleDesignation(getEntity());
+ int indexOfCurrentSampleDesignation = getEntity().getIdentifiers().indexOf(currentSampleDesignation);
+ getEntity().addIdentifier(indexOfCurrentSampleDesignation+1, sampleDesignation);
+ }
+
+}
--- /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.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> {
+
+ protected TextWithLabelElement text_description;
+
+ /**
+ * @param formFactory
+ * @param section
+ * @param entity
+ * @param removeListener
+ * @param backgroundColor
+ * @param style
+ */
+ public SampleDesignationTextDetailElement(CdmFormFactory formFactory, AbstractFormSection<?> section,
+ Identifier 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 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
- }
}
}
import org.apache.log4j.Logger;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
-import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.TimePeriod;
+import eu.etaxonomy.cdm.model.molecular.DnaSample;
import eu.etaxonomy.cdm.model.occurrence.Collection;
import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
* @date 16.12.2013
*
*/
-public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
+public class TissueSampleGeneralDetailElement extends AbstractCdmDetailElement<DnaSample> {
static private final Logger logger = Logger.getLogger(TissueSampleGeneralDetailElement.class);
- //title cache
- //sample designation
private TimePeriodElement datePreparation;
private EntitySelectionElement<AgentBase> selectionPreparedBy;
private TermComboElement<DefinedTerm> comboPreservationMedium;
private TimePeriodElement datePreservation;
- private EntitySelectionElement<AgentBase> selectionStoredAt;
private EntitySelectionElement<Collection> selectionCollection;
private TextWithLabelElement textAccessionNumber;
private TextWithLabelElement textBarcode;
* (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
*/
@Override
- protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
- //FIXME handle all parameters here and in handleEvent()
- datePreparation = formFactory.createTimePeriodElement(formElement, "Preparation date", null, style);
- selectionPreparedBy = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared By", null, EntitySelectionElement.ALL, style);
+ protected void createControls(ICdmFormElement formElement, DnaSample entity, int style) {
+ //TODO handle all parameters here and in handleEvent()
TimePeriod preservationDate = null;
DefinedTerm preservationMedium = null;
- try {
- if(entity.getPreservationMethod()!=null){
- preservationDate = entity.getPreservationMethod().getTimeperiod();
- preservationMedium = entity.getPreservationMethod().getMedium();
- }
- } catch (MethodNotSupportedByDerivedUnitTypeException e) {
- // we ignore this
- MessagingUtils.info(e.getMessage());
+// TimePeriod preparationDate = null;
+// AgentBase preparedBy = null;
+ if(entity.getPreservation()!=null){
+ preservationDate = entity.getPreservation().getTimeperiod();
+ preservationMedium = entity.getPreservation().getMedium();
}
+// datePreparation = formFactory.createTimePeriodElement(formElement, "Preparation date", preparationDate, style);
+// selectionPreparedBy = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared By", preparedBy, EntitySelectionElement.ALL, style);
comboPreservationMedium = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Preservation medium", preservationMedium, style);
datePreservation = formFactory.createTimePeriodElement(formElement, "Preservation date", preservationDate, style);
- selectionStoredAt = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Stored at", null, EntitySelectionElement.ALL, style);
selectionCollection = formFactory.createSelectionElement(Collection.class, getConversationHolder(), formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style);
textAccessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style);
textBarcode = formFactory.createTextWithLabelElement(formElement, "Barcode", entity.getBarcode(), style);
*/
@Override
public void handleEvent(Object eventSource) {
-// if (eventSource==comboPreservationMedium) {
-// addPreservationMethod().setMedium(comboPreservationMedium.getSelection());
-// }
-// else if (eventSource==datePreservation) {
-// addPreservationMethod().setTimeperiod(datePreservation.getTimePeriod());
-// }
-// else if(eventSource==selectionCollection){
-// getEntity().setCollection(selectionCollection.getSelection());
-// }
-// else if(eventSource==textAccessionNumber){
-// getEntity().setAccessionNumber(textAccessionNumber.getText());
-// }
-// else if(eventSource==textBarcode){
-// getEntity().setBarcode(textBarcode.getText());
-// }
+ if(eventSource==selectionPreparedBy) {
+ addPreservationMethod().setActor(selectionPreparedBy.getSelection());
+ }
+ else if(eventSource==comboPreservationMedium) {
+ addPreservationMethod().setMedium(comboPreservationMedium.getSelection());
+ }
+ else if (eventSource==datePreservation) {
+ addPreservationMethod().setTimeperiod(datePreservation.getTimePeriod());
+ }
+ else if(eventSource==selectionCollection){
+ getEntity().setCollection(selectionCollection.getSelection());
+ }
+ else if(eventSource==textAccessionNumber){
+ getEntity().setAccessionNumber(textAccessionNumber.getText());
+ }
+ else if(eventSource==textBarcode){
+ getEntity().setBarcode(textBarcode.getText());
+ }
}
private PreservationMethod addPreservationMethod(){
PreservationMethod preservationMethod = null;
- try {
- preservationMethod = getEntity().getPreservationMethod();
- if(getEntity().getPreservationMethod()==null){
- preservationMethod = PreservationMethod.NewInstance();
- getEntity().setPreservationMethod(preservationMethod);
- }
- } catch (MethodNotSupportedByDerivedUnitTypeException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ preservationMethod = getEntity().getPreservation();
+ if(getEntity().getPreservation()==null){
+ preservationMethod = PreservationMethod.NewInstance();
+ getEntity().setPreservation(preservationMethod);
}
return preservationMethod;
}
import org.eclipse.jface.viewers.ISelectionProvider;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+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;
* @date 12.12.2013
*
*/
-public class TissueSampleGeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> {
+public class TissueSampleGeneralDetailSection extends AbstractCdmDetailSection<DnaSample> {
/**
* @param formFactory
* @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
*/
@Override
- protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+ protected AbstractCdmDetailElement<DnaSample> createCdmDetailElement(AbstractCdmDetailSection<DnaSample> parentElement, int style) {
return formFactory.createTissueSampleGeneralDetailElement(parentElement);
}
*/
package eu.etaxonomy.taxeditor.ui.section.occurrence.media;
-import org.eclipse.swt.widgets.Label;
import org.joda.time.DateTime;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
comboKindOfUnit = formFactory.createDefinedTermComboElement(mediaSpecimenVocabulary, formElement, "Kind of Media", entity.getKindOfUnit(), style);
textTitleLanguageString = formFactory.createLanguageStringWithLabelElement(formElement, "Motif", media.getTitle(), style);
selectionArtist = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Prepared by", media.getArtist(), EntitySelectionElement.ALL, style);
-
- Label label = new Label(getLayoutComposite(), style);
- label.setText("Preparation Date (yyyy-mm-dd)");
- date = new DateElement(formElement.getLayoutComposite(), entity.getMediaSpecimen().getMediaCreated(), style);
- date.initController(formFactory, formElement);
-
-
+ date = formFactory.createDateElement(formElement, "Preparation Date", entity.getMediaSpecimen().getMediaCreated(), style);
textMethodLanguageString = formFactory.createLanguageStringWithLabelElement(formElement, "Method", media.getDescription(Language.getDefaultLanguage()), style);
selection_collection = formFactory.createSelectionElement(Collection.class, getConversationHolder(), formElement, "Collection", entity.getCollection(), EntitySelectionElement.ALL, style);
text_accessionNumber = formFactory.createTextWithLabelElement(formElement, "Accession Number", entity.getAccessionNumber(), style);
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());
CdmDataSourceViewPart view = (CdmDataSourceViewPart) StoreUtil.getView(CdmDataSourceViewPart.ID, false);
if(view != null){
+ container.getMetaDataFromDataSource();
view.getViewer().update(new CdmMetaDataAwareDataSourceContainer[]{container}, null);
}
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
+import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
+import eu.etaxonomy.cdm.model.common.Identifier;
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;
*/
public class DerivateLabelProvider extends ColumnLabelProvider {
+ private static final String NO_SAMPLE_DESIGNATION = "[no sample designation]";
+
private Set<SingleRead> multiLinkSingleReads;
private ConversationHolder conversation;
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
/**
*
- * @param element
+ * @param derivate
* @return
*/
public String getDerivateText(Object element){
+ //TODO: use list of strings to assemble labels to avoid adding the separator every time and to allow null values
+ TreeNode parentNode = null;
+ TreeNode node = null;
+ Object derivate = element;
if(element instanceof TreeNode){
+ node = (TreeNode) element;
+ parentNode = node.getParent();
//unwrap specimen from TreeNode
- element = ((TreeNode) element).getValue();
+ derivate = node.getValue();
}
conversation.bind();
- String label = "";
- if(element instanceof FieldUnit){
- FieldUnit fieldUnit = (FieldUnit)element;
+ final String emptyString = "";
+ final String separator = ", ";
+
+ String label = emptyString;
+
+ //Field Unit
+ if(derivate instanceof FieldUnit){
+ FieldUnit fieldUnit = (FieldUnit)derivate;
if(fieldUnit.getGatheringEvent()!=null){
GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
- if(!conversation.getSession().contains(gatheringEvent)){
+ if(CdmStore.getService(IOccurrenceService.class).exists(fieldUnit.getUuid()) && !conversation.getSession().contains(gatheringEvent)){
fieldUnit = (FieldUnit) CdmStore.getService(IOccurrenceService.class).load(fieldUnit.getUuid());
gatheringEvent = fieldUnit.getGatheringEvent();
}
- label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+", ":"";
- label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+", ":"";
- label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+", ":"";
- label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+", ":"";
+ label += gatheringEvent.getCountry()!=null?gatheringEvent.getCountry().getLabel()+separator:emptyString;
+ label += gatheringEvent.getLocality()!=null?gatheringEvent.getLocality().getText()+separator:emptyString;
+ label += gatheringEvent.getGatheringDate()!=null?gatheringEvent.getGatheringDate()+separator:emptyString;
+ label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
}
- label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber():"";
+ label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber():emptyString;
}
- else if(element instanceof MediaSpecimen){
- MediaSpecimen mediaSpecimen = (MediaSpecimen)element;
+ //MediaSpecimen
+ else if(derivate instanceof MediaSpecimen){
+ MediaSpecimen mediaSpecimen = (MediaSpecimen)derivate;
if(mediaSpecimen.getMediaSpecimen()!=null){
- label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
- label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
+ label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+separator:"[no motif]";
+ label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+separator:emptyString;
}
- 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.getName()!=null?collection.getName()+" ":emptyString;
+ label += collection.getCode()!=null?"("+collection.getCode()+")"+separator:emptyString;
}
+ label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+separator:emptyString;
}
- else if(element instanceof DnaSample
- || (element instanceof DerivedUnit
- && ((SpecimenOrObservationBase<?>) element).getRecordBasis()==SpecimenOrObservationType.DnaSample)){
- //TODO implement
- label += element.toString();
+ //TissueSample + DnaSample
+ else if(derivate instanceof DnaSample){
+ DnaSample dnaSample = (DnaSample)derivate;
+ if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.DnaSample){
+ Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
+ if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
+ label += currentSampleDesignation.getIdentifier()+separator;
+ }
+ else{
+ label += NO_SAMPLE_DESIGNATION+separator;
+ }
+ }
+ else if(((DnaSample) derivate).getRecordBasis()==SpecimenOrObservationType.TissueSample){
+ label += dnaSample.getKindOfUnit()+separator;
+ Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(dnaSample);
+ if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
+ label += currentSampleDesignation.getIdentifier()+separator;
+ }
+ else{
+ label += NO_SAMPLE_DESIGNATION+separator;
+ }
+ }
}
- else if(element instanceof DerivedUnit){
- DerivedUnit derivedUnit = (DerivedUnit)element;
+ //DerivedUnit + TissueSample
+ else if(derivate instanceof DerivedUnit){
+ DerivedUnit derivedUnit = (DerivedUnit)derivate;
if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
java.util.Collection<FieldUnit> fieldUnits = CdmStore.getService(IOccurrenceService.class).getFieldUnits(derivedUnit.getUuid());
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 += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+separator:emptyString;
}
- label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+", ":"";
+ label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+separator:emptyString;
}
- 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()+"), ":"";
+ label += collection.getName()!=null?collection.getName()+" ":emptyString;
+ label += collection.getCode()!=null?"("+collection.getCode()+"), ":emptyString;
}
- label += derivedUnit.getAccessionNumber()!=null?derivedUnit.getAccessionNumber()+", ":"";
- label += derivedUnit.getBarcode()!=null?derivedUnit.getBarcode():"";
+ label += derivedUnit.getAccessionNumber()!=null?derivedUnit.getAccessionNumber()+separator:emptyString;
+ label += derivedUnit.getBarcode()!=null?derivedUnit.getBarcode():emptyString;
}
else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
- //TODO: implement
-// kindofTissue + SampleDesignation
+ //TissueSample should only be created by using it's own class
+ //in future using only one class with different SpecimenOrObservationTypes is desired
+// label += derivedUnit.getKindOfUnit() + NO_SAMPLE_DESIGNATION;
}
}
- else if(element instanceof Sequence){
- Sequence sequence = (Sequence)element;
- label += "SampleDesignation?"+", ";
- label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():"";
+ //Sequence
+ else if(derivate instanceof Sequence){
+ Sequence sequence = (Sequence)derivate;
+ Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
+ if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
+ label += currentSampleDesignation.getIdentifier()+separator;
+ }
+ else{
+ label += NO_SAMPLE_DESIGNATION+separator;
+ }
+ label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():emptyString;
}
- else if(element instanceof SingleRead){
- SingleRead singleRead = (SingleRead)element;
- label += singleRead.getPrimer()!=null?singleRead.getPrimer().getLabel()+", ":"";
- label += "Marker?";
+ //SingleRead
+ else if(derivate instanceof SingleRead){
+ SingleRead singleRead = (SingleRead)derivate;
+ if(parentNode!=null && parentNode.getValue() instanceof Sequence){
+ Sequence sequence = (Sequence) parentNode.getValue();
+ Identifier<DnaSample> currentSampleDesignation = getCurrentSampleDesignation(sequence);
+ if(currentSampleDesignation!=null && currentSampleDesignation.getIdentifier()!=null){
+ label = currentSampleDesignation.getIdentifier()+separator;
+ }
+ else{
+ label += NO_SAMPLE_DESIGNATION+separator;
+ }
+ label += singleRead.getPrimer()!=null?singleRead.getPrimer().getLabel()+separator:emptyString;
+ if(sequence!=null){
+ label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():emptyString;
+ }
+ }
}
- else if(element instanceof SpecimenOrObservationBase){
- SpecimenOrObservationBase<?> derivate = (SpecimenOrObservationBase<?>) element;
- SpecimenOrObservationType type = derivate.getRecordBasis();
- return derivate.getTitleCache() + (type!=null?" ["+type.toString()+"]":"");
+ //SOOB
+ else if(derivate instanceof SpecimenOrObservationBase){
+ SpecimenOrObservationBase<?> specimen = (SpecimenOrObservationBase<?>) derivate;
+ SpecimenOrObservationType type = specimen.getRecordBasis();
+ return specimen.getTitleCache() + (type!=null?" ["+type.toString()+"]":emptyString);
}
if(label.isEmpty()){
- label = element.toString();
+ label = derivate.toString();
}
//remove last comma
- else if(label.endsWith(", ")){
- label = label.substring(0, label.length()-2);
+ else if(label.endsWith(separator)){
+ label = label.substring(0, label.length()-separator.length());
}
return label;
}
return super.getImage(element);
}
+ public static Identifier<DnaSample> getCurrentSampleDesignation(CdmBase entity) {
+ if(entity instanceof DnaSample){
+ DnaSample dnaSample = (DnaSample)entity;
+ for (Identifier<DnaSample> identifier : dnaSample.getIdentifiers()) {
+ if(identifier.getType()!=null && identifier.getType().equals(DerivateLabelProvider.getSampleDesignationTerm())){
+ //first sample designation is the current
+ return identifier;
+ }
+ }
+ }
+ else if(entity instanceof Sequence){
+ Sequence sequence = (Sequence)entity;
+ if(sequence.getDnaSample()!=null){
+ return getCurrentSampleDesignation(sequence.getDnaSample());
+ }
+ }
+ return null;
+ }
+
/**
* @param multiLinkSingleReads2
*/
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;
createDerivedUnitBaseElementSection(rootElement);
}
else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.TissueSample){
- createTissueSampleSection(rootElement);
+ //TissueSample should only be created by using it's own class
+ //in future using only one class with different SpecimenOrObservationTypes is desired
+// createTissueSampleSection(rootElement);
}
else if(((DerivedUnitFacade) input).getType()==SpecimenOrObservationType.StillImage){
createSpecimenScanSection(rootElement);
createDerivedUnitBaseElementSection(rootElement);
}
} else if (input instanceof DnaSample){
- createDnaSampleSection(rootElement);
+ DnaSample dnaSample = (DnaSample)input;
+ if(dnaSample.getRecordBasis()==SpecimenOrObservationType.TissueSample){
+ createTissueSampleSection(rootElement);
+ }
+ else if(dnaSample.getRecordBasis()==SpecimenOrObservationType.DnaSample){
+ createDnaSampleSection(rootElement);
+ }
} else if (input instanceof MediaSpecimen){
createMediaSpecimenSection(rootElement);
}
TissueSampleGeneralDetailSection section = formFactory.createTissueSampleGeneralDetailSection(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(sampleDesignationDetailSection);
}
private void createDnaSampleSection(RootElement parent) {
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>