merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 4 Aug 2014 10:08:37 +0000 (10:08 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 4 Aug 2014 10:08:37 +0000 (10:08 +0000)
29 files changed:
.gitattributes
eu.etaxonomy.taxeditor.cdmlib/.classpath
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.cdmlib/build.properties
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorContextMenu.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/transientServices/TransientOccurenceService.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateView.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateDerivateContextMenu.java
eu.etaxonomy.taxeditor.store/.classpath
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/icons/character_data_derivate-16x16-32.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/CdmFormFactory.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/OriginalLabelDataSection.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/SequenceGeneralDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/datasource/CdmDataSourceViewPart.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchCompositeController.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateSearchView.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/detail/CdmSectionPart.java
pom.xml

index ba2b9885c191e221b6f815bae215f3d5a8c02365..9d1eca209faa75b484de5b0a32a07a1bdc91950b 100644 (file)
@@ -1001,6 +1001,7 @@ eu.etaxonomy.taxeditor.store/icons/binary.gif -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
@@ -1382,6 +1383,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/Lay
 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
@@ -1399,8 +1401,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/group/grant
 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
index 2ec26937c916b9a915e70b94089df5724ab7788a..ad6b2164196f143203a991a032968e4eba5d6723 100644 (file)
        <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.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-commons-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-ext-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-io-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-model-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-persistence-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-print-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-remote-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.3.7-SNAPSHOT-sources.jar"/>
-       <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.3.7-SNAPSHOT.jar" sourcepath="lib/cdmlib-services-3.3.7-SNAPSHOT-sources.jar"/>
+       <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" sourcepath="lib/cdmlib-commons-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-ext-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-io-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-model-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-persistence-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-print-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-remote-3.4.0-SNAPSHOT-sources.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" sourcepath="lib/cdmlib-services-3.4.0-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"/>
index 5a7ae1ba65d0b4a22526703c7b339e179a274222..ae9176e855516657f39f8d25162d1227acd24505 100644 (file)
@@ -430,22 +430,6 @@ Bundle-ClassPath: .,
  lib/batik-util-1.7.jar,
  lib/batik-xml-1.7.jar,
  lib/c3p0-0.9.2.jar,
- lib/cdmlib-commons-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-commons-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-ext-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-ext-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-io-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-io-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-model-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-model-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-persistence-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-persistence-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-print-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-print-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-remote-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-remote-3.3.7-SNAPSHOT.jar,
- lib/cdmlib-services-3.3.7-SNAPSHOT-sources.jar,
- lib/cdmlib-services-3.3.7-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,
@@ -609,5 +593,21 @@ Bundle-ClassPath: .,
  lib/google-api-translate-java-0.92.jar,
  lib/odfdom-0.8.jar,
  lib/h2mig_pagestore_addon.jar,
- lib/spring-security-remoting-3.1.3.RELEASE.jar
+ lib/spring-security-remoting-3.1.3.RELEASE.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
index ec0b624f71a3a8059c95238846ca0f882435fc4e..69211ff4d6c842ec6d8c0ae6ea8dad4d7c1e8cdc 100644 (file)
@@ -23,22 +23,6 @@ bin.includes = META-INF/,\
                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.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-commons-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-ext-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-ext-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-io-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-io-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-model-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-model-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-persistence-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-persistence-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-print-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-print-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-remote-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-remote-3.3.7-SNAPSHOT.jar,\\r
-               lib/cdmlib-services-3.3.7-SNAPSHOT-sources.jar,\\r
-               lib/cdmlib-services-3.3.7-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
@@ -202,7 +186,23 @@ bin.includes = META-INF/,\
                lib/google-api-translate-java-0.92.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/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
 jars.compile.order = .\r
 output.. = bin/\r
 source.. = src/main/java/,\\r
index 9fb167cc8644ced846238dee40784f7341832719..4cf488ee33f1a17bac6e7badc2adfac6cf54f75d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
index 25f118068392d39fda76feea6c855dfb3633db17..f131a431cbf20a8f2194c84912950bd3e0a6485b 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index d556221c8047671c0d13d992bea81a35e6644b08..4c2735fc52620dc6847b40af8def4416b37f497e 100644 (file)
@@ -31,6 +31,7 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifQueryServiceWrapper;
 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 {
@@ -47,7 +48,7 @@ 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;
index 77402df6a1a8f7cd0277cf3ec93bb8f51f651e96..94900067a4b7a2f02bc001e9848e6f03dc63147d 100644 (file)
@@ -31,6 +31,7 @@ import eu.etaxonomy.cdm.api.service.DeleteResult;
 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;
@@ -914,4 +915,24 @@ public class TransientOccurenceService implements IOccurrenceService {
                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#listDerivateHierarchyDTOsByAssociatedTaxon(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<DerivateHierarchyDTO> listDerivateHierarchyDTOsByAssociatedTaxon(
+            Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize,
+            Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+        return defaultService.listDerivateHierarchyDTOsByAssociatedTaxon(includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
+    }
+
 }
index bab27cfed83353fb37aa25949f082ea979737abf..527859a4c3179aaf2cc77901c476ffdcd35ccf5f 100644 (file)
@@ -11,6 +11,7 @@ import org.eclipse.jface.util.LocalSelectionTransfer;
 import org.eclipse.jface.viewers.AbstractTreeViewer;
 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;
@@ -22,7 +23,6 @@ import org.eclipse.swt.widgets.Tree;
 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;
 
@@ -34,7 +34,6 @@ import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
 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.IDirtyMarkableSelectionProvider;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
@@ -47,7 +46,7 @@ import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
  *
  */
 public class DerivateView extends EditorPart implements IPartContentHasFactualData, IDirtyMarkableSelectionProvider,
-        IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener {
+        IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData {
 
        /**
      * Key used for storing a single DerivateView in a memento
@@ -77,7 +76,6 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
      * Default constructor
      */
     public DerivateView() {
-        CdmStore.getContextManager().addContextListener(this);
     }
 
     /* (non-Javadoc)
@@ -233,6 +231,19 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.refresh();
     }
 
+    /**
+     * 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
      */
@@ -242,6 +253,7 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         viewer.refresh();
     }
 
+
     private void generateMultiLinkSingleReads() {
         Set<SingleRead> multiLinkSingleReads = new HashSet<SingleRead>();
         for(Entry<SingleRead, Collection<Sequence>> entry:CdmStore.getService(ISequenceService.class).getSingleReadSequencesMap().entrySet()){
@@ -259,62 +271,4 @@ public class DerivateView extends EditorPart implements IPartContentHasFactualDa
         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);
-//        }
-    }
-
 }
index b956e86c779337c9dc9e6335f021c44b07749fe0..b2d6da8bcbfe59f3106467702fa9563068742fa2 100644 (file)
@@ -71,10 +71,12 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                             //context menu for TissueSample
                             else if(selectedTreeNode.getValue() instanceof DerivedUnit && ((DerivedUnit)selectedTreeNode.getValue()).getRecordBasis()==SpecimenOrObservationType.TissueSample){
                                createMenuItem(addMenu, "DnaSample", selectedTreeNode, DnaSample.class, null);
+                               createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media);
                             }
                             //context menu for DnaSample
                             else if(selectedTreeNode.getValue() instanceof DnaSample){
                                 createMenuItem(addMenu, "Consensus Sequence", selectedTreeNode, Sequence.class, null);
+                                createMenuItem(addMenu, "Media Specimen", selectedTreeNode, MediaSpecimen.class, SpecimenOrObservationType.Media);
                             }
                             //context menu for Sequence
                             else if(selectedTreeNode.getValue() instanceof Sequence){
@@ -123,15 +125,20 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
          */
         @Override
         public void widgetSelected(SelectionEvent e) {
+            Object createdElement = null;
             Object selectedDerivate = selectedNode.getValue();
             if(selectedDerivate instanceof DnaSample){
                 DnaSample dnaSample = (DnaSample)selectedDerivate;
                 if(childClass.equals(Sequence.class)){
-                    dnaSample.addSequence(Sequence.NewInstance(""));//why does this not have DnaSample as constructor parameter?
+                    Sequence newInstance = Sequence.NewInstance("");
+                    dnaSample.addSequence(newInstance);//why does this not have DnaSample as constructor parameter?
+                    createdElement = newInstance;
                 }
             }
             else if(selectedDerivate instanceof Sequence){
-                ((Sequence) selectedDerivate).addSingleRead(SingleRead.NewInstance());
+                SingleRead newInstance = SingleRead.NewInstance();
+                ((Sequence) selectedDerivate).addSingleRead(newInstance);
+                createdElement = newInstance;
             }
             else if(selectedDerivate instanceof SpecimenOrObservationBase && DerivedUnit.class.isAssignableFrom(childClass)){
                 SpecimenOrObservationBase<?> specimenOrObservationBase = (SpecimenOrObservationBase<?>)selectedDerivate;
@@ -150,6 +157,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
                 specimenOrObservationBase.addDerivationEvent(DerivationEvent.NewSimpleInstance(specimenOrObservationBase, derivedUnit, DerivationEventType.GATHERING_IN_SITU()));
                 derivedUnit.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
                 derivedUnit.getTitleCache(); //update title cache
+                createdElement = derivedUnit;
             }
 
             //refresh view
@@ -157,7 +165,7 @@ public class CreateDerivateContextMenu extends CompoundContributionItem {
             if(activePart instanceof DerivateView){
                 DerivateView derivateView = (DerivateView)activePart;
                 derivateView.changed(null);
-                derivateView.refreshTree();
+                derivateView.refreshTree(createdElement);
             }
         }
     }
index ee4c1eaf51a36033492cb5045bdfeef04799db80..753a09f69dd49e88d13a9a38663f801af121a6b5 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <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 including="**/*.java" kind="src" path="src/main/java"/>
        <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
        <classpathentry kind="src" path="src/main/resources"/>
        <classpathentry including="**/*.java" kind="src" path="src/test/resources"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="target/classes"/>
 </classpath>
index f3a5d62f5f363ffda234e6ec746fe8e6ce0b550b..b60fa04e1bda53470368fc4d50d534d2c6c0ab78 100644 (file)
@@ -58,7 +58,12 @@ Require-Bundle: org.eclipse.osgi,
  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,
diff --git a/eu.etaxonomy.taxeditor.store/icons/character_data_derivate-16x16-32.png b/eu.etaxonomy.taxeditor.store/icons/character_data_derivate-16x16-32.png
new file mode 100644 (file)
index 0000000..b9dd5ef
Binary files /dev/null and b/eu.etaxonomy.taxeditor.store/icons/character_data_derivate-16x16-32.png differ
index 1a40df53cf34b9973a81dfc06913763c65dfd3b7..310b871b40ccdd377c8337a0588727a04b6a6fc3 100644 (file)
@@ -147,6 +147,8 @@ public class ImageResources {
     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";
+
 
 
        /***************************************************************************
@@ -347,6 +349,9 @@ public class ImageResources {
                        "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,
index 7c69824f8dd49102e463b1fefbb0169d2ef9b533..74de20b68d564e75c2c06d2d0135c0ae2062f299 100644 (file)
@@ -100,8 +100,6 @@ import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.MinMaxTextSection.UnitType;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataController;
-import eu.etaxonomy.taxeditor.ui.mvc.OriginalLabelDataElement;
 import eu.etaxonomy.taxeditor.ui.openurl.IOpenUrlEnabled;
 import eu.etaxonomy.taxeditor.ui.openurl.OpenUrlSelectorElement;
 import eu.etaxonomy.taxeditor.ui.password.EditPasswordElement;
@@ -2188,6 +2186,12 @@ public class CdmFormFactory extends FormToolkit {
         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);
@@ -2758,14 +2762,4 @@ public class CdmFormFactory extends FormToolkit {
         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();
-    }
-
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/OriginalLabelDataElement.java
new file mode 100644 (file)
index 0000000..e5753d1
--- /dev/null
@@ -0,0 +1,63 @@
+// $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());
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataController.java
deleted file mode 100644 (file)
index d085ec3..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// $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) {
-    }
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataElement.java
deleted file mode 100644 (file)
index d064f6d..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// $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;
-    }
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/mvc/OriginalLabelDataField.java
new file mode 100644 (file)
index 0000000..3603e4d
--- /dev/null
@@ -0,0 +1,113 @@
+// $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();
+            }
+        }
+    }
+
+}
index 00c732c4d3d3be9796a19b4c0228801778c11c67..45eec3ef23ff560ba8b206ee017c1c7cb4345b1d 100644 (file)
@@ -16,6 +16,8 @@ import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
@@ -51,7 +53,7 @@ public class DerivedUnitGeneralDetailElement extends
        private TextWithLabelElement text_accessionNumber;
        private GatheringEventUnitElement element_elevation;
 
-       
+
 
        /**
         * @param formFactory
@@ -75,10 +77,12 @@ public class DerivedUnitGeneralDetailElement extends
                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());
+
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
+            combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement,
+                    style);
+            combo_specorobstype.setSelection(entity.getType());
+        }
                selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(),
                                formElement, "Country",
                                entity.getCountry(), EntitySelectionElement.NOTHING, style);
@@ -89,7 +93,7 @@ public class DerivedUnitGeneralDetailElement extends
                                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
index d73d9ae5c5d1e7dc0b3ff06ce1a89bb45beb5e8b..622e8b7f954eb16a433dcc6d3a72d3fc9d3edd5f 100644 (file)
@@ -14,6 +14,8 @@ import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.location.NamedArea;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.GatheringEventUnitElement;
@@ -65,8 +67,11 @@ public class FieldUnitGeneralDetailElement extends AbstractCdmDetailElement<Deri
     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());
+
+        if(!PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
+            combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
+            combo_specorobstype.setSelection(entity.getType());
+        }
         selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(), formElement,
                 "Country", entity.getCountry(), EntitySelectionElement.NOTHING, style);
         languageText_locality = formFactory.createLanguageStringWithLabelElement(formElement, "Locality",
@@ -74,7 +79,7 @@ public class FieldUnitGeneralDetailElement extends AbstractCdmDetailElement<Deri
         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);
index 635dfd4226ed0bead42cbf829bcacc6fb284af7e..e4c1602b27a5eaa2319885d334bf5a6e3fd4eb38 100644 (file)
@@ -43,26 +43,7 @@ public class OriginalLabelDataSection extends AbstractCdmDetailSection<DerivedUn
      */
     @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)
@@ -70,7 +51,7 @@ public class OriginalLabelDataSection extends AbstractCdmDetailSection<DerivedUn
      */
     @Override
     protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
-        return formFactory.createOriginalLabelDataController(parentElement);
+        return formFactory.createOriginalLabelDataElement(parentElement);
     }
 
 }
index f03ea461d12c6aaedcf52fd31a41dfb45c268c87..cac6b3785409d9a6a84dfc84cc08ad0b5f9abf36 100644 (file)
@@ -9,6 +9,8 @@
 */
 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;
@@ -56,13 +58,13 @@ public class SequenceGeneralDetailElement extends AbstractCdmDetailElement<Seque
         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);
+        ((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);
         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);
 
     }
 
index 3cbafb3844980b5d28ff30c1c4e23ffcb66d0208..ca1519081b2ca09dd7185af4636b5b7a6c4c059b 100644 (file)
@@ -1,9 +1,9 @@
 // $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.
 */
@@ -47,15 +47,13 @@ import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.springframework.security.core.GrantedAuthority;
 
 import eu.etaxonomy.cdm.config.ICdmSource;
-import eu.etaxonomy.cdm.database.ICdmDataSource;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.ContextListenerAdapter;
 import eu.etaxonomy.taxeditor.model.IContextListener;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 
 /**
  * <p>CdmDataSourceViewPart class.</p>
@@ -65,9 +63,9 @@ import eu.etaxonomy.taxeditor.store.StoreUtil;
  * @version 1.0
  */
 public class CdmDataSourceViewPart extends ViewPart{
-       
+
     private static final Logger logger = Logger.getLogger(CdmDataSourceViewPart.class);
-       
+
        private class ContextListener extends ContextListenerAdapter{
                /* (non-Javadoc)
                 * @see eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
@@ -75,7 +73,7 @@ public class CdmDataSourceViewPart extends ViewPart{
                @Override
                public void contextAboutToStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Refreshing Datasource View");
-                       viewer.refresh();       
+                       viewer.refresh();
                }
 
                /* (non-Javadoc)
@@ -84,7 +82,7 @@ public class CdmDataSourceViewPart extends ViewPart{
                @Override
                public void contextStop(IMemento memento, IProgressMonitor monitor) {
                        monitor.subTask("Refreshing Datasource View");
-                       viewer.refresh();       
+                       viewer.refresh();
                }
 
                /* (non-Javadoc)
@@ -96,10 +94,10 @@ public class CdmDataSourceViewPart extends ViewPart{
                        viewer.refresh();
                }
        }
-       
+
        private class DataSourceJob extends Job{
 
-               private List<ICdmSource> cdmSources;
+               private final List<ICdmSource> cdmSources;
 
                /**
                 * @param name
@@ -116,94 +114,104 @@ public class CdmDataSourceViewPart extends ViewPart{
                public IStatus run(final IProgressMonitor monitor) {
                        try{
                                logger.debug("Begin of eclipse core runtime Job to Retrieve datasources");
-                               monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);                     
-                               
+                               monitor.beginTask("Retrieving datasources", cdmSources.size() + 1);
+
                                final List<CdmMetaDataAwareDataSourceContainer> containers = new ArrayList<CdmMetaDataAwareDataSourceContainer>();
-                               
+
                                for(ICdmSource cdmSource : cdmSources){
                                        containers.add(new CdmMetaDataAwareDataSourceContainer(cdmSource));
                                }
-                               
+
                                Display.getDefault().asyncExec(new Runnable() {
-                                       
+
                                        @Override
                                        public void run() {
                                                viewer.setInput(containers);
                                        }
                                });
                                monitor.worked(1);
-                               
+
                                for(final CdmMetaDataAwareDataSourceContainer container : containers){
-                                       
-                                       
-                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : next DataSourceContainer");                                         
+
+
+                                       if(logger.isDebugEnabled()) {
+                        logger.debug("  #" + container.hashCode() + " : next DataSourceContainer");
+                    }
                                        container.getMetaDataFromDataSource();
-                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");    
+                                       if(logger.isDebugEnabled()) {
+                        logger.debug("  #" + container.hashCode() + " : metadata retrieved, creating new runnable ...");
+                    }
                                        Display.getDefault().asyncExec(new Runnable() {
-                                               
+
                                                @Override
                                                public void run() {
-                                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " starting sub thread to update ...");  
+                                                       if(logger.isDebugEnabled()) {
+                                logger.debug("  #" + container.hashCode() + " starting sub thread to update ...");
+                            }
                                                        viewer.update(container, null);
-                                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " end of sub thread to update ...");    
+                                                       if(logger.isDebugEnabled()) {
+                                logger.debug("  #" + container.hashCode() + " end of sub thread to update ...");
+                            }
                                                }
                                        });
-                                       if(logger.isDebugEnabled()) logger.debug("  #" + container.hashCode() + " done");       
+                                       if(logger.isDebugEnabled()) {
+                        logger.debug("  #" + container.hashCode() + " done");
+                    }
                                        monitor.worked(1);
                                }
-                               
+
                        }finally{
                                monitor.done();
                        }
                        return Status.OK_STATUS;
                }
        }
-       
+
        /** Constant <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code> */
        public static String ID = "eu.etaxonomy.taxeditor.view.datasource";
-       
+
        private TableViewer viewer;
 
        private String partNameCache;
 
        private IWorkbenchSiteProgressService service;
-       
+
        private IContextListener contextListener;
 
        private CdmDataSourceViewerComparator comparator;
-       
+
        /**
         * <p>Constructor for CdmDataSourceViewPart.</p>
         */
        public CdmDataSourceViewPart(){
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
                service = (IWorkbenchSiteProgressService) getSite().getAdapter(IWorkbenchSiteProgressService.class);
                contextListener = new ContextListener();
                CdmStore.getContextManager().addContextListener(contextListener);
-               
+
                // Create top composite
                FillLayout fillLayout = new FillLayout();
                fillLayout.marginWidth = 0;
                fillLayout.marginHeight = 0;
-               fillLayout.type = SWT.VERTICAL; 
+               fillLayout.type = SWT.VERTICAL;
                parent.setLayout(fillLayout);
-               
+
                viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
                                                                                                | SWT.V_SCROLL | SWT.FULL_SELECTION);
                getSite().setSelectionProvider(viewer);
-               
+
                createColumns(viewer);
-               
+
                viewer.setContentProvider(new CdmDataSourceContentProvider());
                viewer.setLabelProvider(new CdmDataSourceLabelProvider());
                comparator = new CdmDataSourceViewerComparator();
                viewer.setComparator(comparator);
-               
-               
+
+
                // register context menu
                MenuManager menuMgr = new MenuManager();
                menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
@@ -211,47 +219,48 @@ public class CdmDataSourceViewPart extends ViewPart{
 
                Control control = viewer.getControl();
                Menu menu = menuMgr.createContextMenu(control);
-               control.setMenu(menu);  
-               
+               control.setMenu(menu);
+
                // connect on doubleclick
                viewer.addDoubleClickListener(new IDoubleClickListener() {
 
-                       public void doubleClick(DoubleClickEvent event) {
+                       @Override
+            public void doubleClick(DoubleClickEvent event) {
                                if (event.getSelection() instanceof StructuredSelection) {
-                                       
+
                                        Object element = ((StructuredSelection) event
                                                        .getSelection()).getFirstElement();
                                        if (element instanceof CdmMetaDataAwareDataSourceContainer) {
                                                String commandId = "eu.etaxonomy.taxeditor.store.datasource.change";
-                                               
+
                                                ICommandService commandService = (ICommandService)getSite().getService(ICommandService.class);
-                                               
-                                               Command command = commandService.getCommand(commandId); 
+
+                                               Command command = commandService.getCommand(commandId);
                                                if(command.isEnabled()) {
-                                               
-                                                       IHandlerService handlerService = (IHandlerService) StoreUtil.getService(IHandlerService.class);
-                                                       
+
+                                                       IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
+
                                                        try {
                                                                handlerService.executeCommand(commandId, null);
                                                        } catch (ExecutionException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               AbstractUtility.error(this.getClass(), e);
                                                        } catch (NotDefinedException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               AbstractUtility.error(this.getClass(), e);
                                                        } catch (NotEnabledException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               AbstractUtility.error(this.getClass(), e);
                                                        } catch (NotHandledException e) {
-                                                               StoreUtil.error(this.getClass(), e);
+                                                               AbstractUtility.error(this.getClass(), e);
                                                        }
                                                }
                                        }
                                }
                        }
                });
-               
+
                refresh();
        }
 
-       
+
        // This will create the columns for the table
        private void createColumns(TableViewer viewer) {
                Table table = viewer.getTable();
@@ -272,13 +281,13 @@ public class CdmDataSourceViewPart extends ViewPart{
                table.setHeaderVisible(true);
                table.setLinesVisible(true);
                table.setSortDirection(SWT.UP);
-               
+
        }
-       
+
        /**
         * <p>refresh</p>
         */
-       public void refresh(){          
+       public void refresh(){
                getService().schedule(new DataSourceJob("Loading datasources", CdmDataSourceRepository.getAll()), Job.LONG);
        }
 
@@ -292,10 +301,10 @@ public class CdmDataSourceViewPart extends ViewPart{
        /** {@inheritDoc} */
        @Override
        public void setFocus() {
-               viewer.getControl().setFocus();
+//             viewer.getControl().setFocus();
        }
 
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
         */
@@ -331,7 +340,7 @@ public class CdmDataSourceViewPart extends ViewPart{
        public IWorkbenchSiteProgressService getService() {
                return service;
        }
-       
+
        private SelectionAdapter getSelectionAdapter(final TableColumn column,
                        final int index) {
                SelectionAdapter selectionAdapter = new SelectionAdapter() {
index d628deaaac6e025d30594b0895c2e23e9fb64beb..858023070de7893d3cde0e357bb971e7f0b7c4e4 100644 (file)
@@ -24,7 +24,6 @@ import eu.etaxonomy.cdm.model.common.DefinedTerm;
 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;
@@ -116,7 +115,9 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
      * @return
      */
     public static String getDerivateText(Object element){
+        TreeNode parentNode = null;
         if(element instanceof TreeNode){
+            parentNode = ((TreeNode) element).getParent();
             //unwrap specimen from TreeNode
             element = ((TreeNode) element).getValue();
         }
@@ -138,7 +139,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
             label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
             label += mediaSpecimen.getAccessionNumber()!=null?mediaSpecimen.getAccessionNumber()+", ":"";
-            Collection collection = mediaSpecimen.getCollection();
+            eu.etaxonomy.cdm.model.occurrence.Collection collection = mediaSpecimen.getCollection();
             if(collection!=null){
                 label += collection.getName()!=null?collection.getName()+" ":"";
             }
@@ -146,8 +147,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         else if(element instanceof DnaSample
                 || (element instanceof DerivedUnit
                         && ((SpecimenOrObservationBase<?>) element).getRecordBasis()==SpecimenOrObservationType.DnaSample)){
-            //TODO implement
-            label += element.toString();
+            label += "SampleDesignation?";
 
         }
         else if(element instanceof DerivedUnit){
@@ -157,12 +157,13 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
                 if(fieldUnits!=null && !fieldUnits.isEmpty()){
                     FieldUnit fieldUnit = fieldUnits.iterator().next();
                     GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();
+//                    gatheringEvent = HibernateProxyHelper.deproxy(gatheringEvent, GatheringEvent.class);
                     if(gatheringEvent!=null){
                         label += gatheringEvent.getCollector()!=null?gatheringEvent.getCollector()+", ":"";
                     }
                     label += fieldUnit.getFieldNumber()!=null?fieldUnit.getFieldNumber()+", ":"";
                 }
-                Collection collection = derivedUnit.getCollection();
+                eu.etaxonomy.cdm.model.occurrence.Collection collection = derivedUnit.getCollection();
                 if(collection!=null){
                     label += collection.getName()!=null?collection.getName()+" ":"";
                     label += collection.getCode()!=null?"("+collection.getCode()+"), ":"";
@@ -172,7 +173,7 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
             }
             else if(derivedUnit.getRecordBasis()==SpecimenOrObservationType.TissueSample){
                 //TODO: implement
-//                kindofTissue + SampleDesignation
+                label += "kindofTissue? + SampleDesignation?";
             }
         }
         else if(element instanceof Sequence){
@@ -182,8 +183,12 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         }
         else if(element instanceof SingleRead){
             SingleRead singleRead = (SingleRead)element;
+            label += "SampleDesignation?"+", ";
             label += singleRead.getPrimer()!=null?singleRead.getPrimer().getLabel()+", ":"";
-            label += "Marker?";
+            if(parentNode!=null && parentNode.getValue() instanceof Sequence){
+                Sequence sequence = (Sequence) parentNode.getValue();
+                label += sequence.getDnaMarker()!=null?sequence.getDnaMarker():"";
+            }
         }
         else if(element instanceof SpecimenOrObservationBase){
             SpecimenOrObservationBase<?> derivate = (SpecimenOrObservationBase<?>) element;
index 76a6b5aee81207d22de8161df328b24ecd01f04c..ad861b21a1f882301c665f6f537cfeaa09c1de81 100644 (file)
@@ -50,12 +50,15 @@ public class DerivateSearchCompositeController implements Listener{
     private final DerivateSearchComposite derivateSearchComposite;
     private IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>> configurator;
     private EnumTermComboController<SpecimenOrObservationType> enumTermComboController;
+    private final DerivateSearchView derivateSearchView;
 
     /**
      * @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();
     }
 
@@ -102,6 +105,10 @@ public class DerivateSearchCompositeController implements Listener{
     }
 
     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
@@ -147,6 +154,7 @@ public class DerivateSearchCompositeController implements Listener{
     public void reset(){
         derivateSearchComposite.getResultViewer().setInput(null);
         derivateSearchComposite.getSearchField().setText("");
+        enumTermComboController.setSelection(SpecimenOrObservationType.Unknown);
         derivateSearchComposite.getComboDerivateType().deselectAll();
     }
 
index ddd4b1a20dba1cd3283da47aa4fa965e6d88c98b..c3e973ef0b0024613450489f2a34dd6ff14111f6 100644 (file)
@@ -41,7 +41,7 @@ public class DerivateSearchView extends ViewPart implements IContextListener {
      */
     @Override
     public void createPartControl(Composite parent) {
-        derivateSearchCompositeController = new DerivateSearchCompositeController(parent);
+        derivateSearchCompositeController = new DerivateSearchCompositeController(parent, this);
         getSite().setSelectionProvider(derivateSearchCompositeController.getResultViewer());
         derivateSearchCompositeController.setEnabled(CdmStore.isActive());
     }
index 285fd520e215a93de38eb167bf549f091793380a..53e294b551735e856982c156c5b3a267d4516494 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.view.detail;
 
 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;
@@ -120,15 +121,23 @@ public class CdmSectionPart<T> extends SectionPart implements
                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();
                        }
                }
        }
diff --git a/pom.xml b/pom.xml
index ea4c44cfa8b3a4ae00e86328e4b7802455264c6f..86e67931cbccc11ccfdf70844a392d3183bf51f4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
   <properties>
     <java.codelevel>1.6</java.codelevel>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <cdmlib.version>3.3.7-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.7-SNAPSHOT</taxeditor.version>