- added new DataImportEditor for displaying/editing results of specimen search wizard
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 23 Sep 2013 15:48:39 +0000 (15:48 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 23 Sep 2013 15:48:39 +0000 (15:48 +0000)
 - disabled PreservationMethod related widget as they have not been adapted to the model changes yet

15 files changed:
.gitattributes
eu.etaxonomy.taxeditor.bulkeditor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/annotatedlineeditor/AnnotatedLineDocumentProvider.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/SpecimenEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchWizard.java with 74% similarity]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizardPage.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchWizardPage.java with 96% similarity]
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.store/plugin.xml
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchResultWizardPage.java [deleted file]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/detailViews/specimen/DerivedUnitDetailsElementController.java

index eca619f026173b88a913a7a77b8c511334144d8f..84b6c5f46fcc7dd2349b16abc9cfbe01342b75c9 100644 (file)
@@ -115,6 +115,11 @@ eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkedito
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsContentProvider.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsLabelProvider.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/SpecimenEditorInput.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizard.java -text
+eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/wizard/SpecimenSearchWizardPage.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/Application.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/ApplicationActionBarAdvisor.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/test/java/eu/etaxonomy/taxeditor/bulkeditor/ApplicationWorkbenchAdvisor.java -text
@@ -1111,9 +1116,6 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SddI
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/SpecimenCdmExcelImportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/TcsExportWizard.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/TcsImportWizard.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchResultWizardPage.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchWizard.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchWizardPage.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/labels/DefaultLabelStrategy.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/labels/ILabelImageStrategy.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/labels/LabelImageProvider.java -text
index 52afe75df3244dc50312207724258efd7adfbfcf..4a9ba723cfe9e7169ab08d1bfec65943b4e05a23 100644 (file)
@@ -5,7 +5,16 @@ Bundle-SymbolicName: eu.etaxonomy.taxeditor.bulkeditor;singleton:=true
 Bundle-Version: 3.2.3.201308261400
 Bundle-Activator: eu.etaxonomy.taxeditor.bulkeditor.internal.TaxeditorBulkeditorPlugin
 Bundle-Vendor: EDIT
-Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,eu.etaxonomy.taxeditor.annotatedlineeditor.handler,eu.etaxonomy.taxeditor.bulkeditor,eu.etaxonomy.taxeditor.bulkeditor.command,eu.etaxonomy.taxeditor.bulkeditor.handler,eu.etaxonomy.taxeditor.bulkeditor.input,eu.etaxonomy.taxeditor.bulkeditor.internal,eu.etaxonomy.taxeditor.bulkeditor.referencingobjects
+Export-Package: eu.etaxonomy.taxeditor.annotatedlineeditor,
+ eu.etaxonomy.taxeditor.annotatedlineeditor.handler,
+ eu.etaxonomy.taxeditor.bulkeditor,
+ eu.etaxonomy.taxeditor.bulkeditor.command,
+ eu.etaxonomy.taxeditor.bulkeditor.handler,
+ eu.etaxonomy.taxeditor.bulkeditor.input,
+ eu.etaxonomy.taxeditor.bulkeditor.internal,
+ eu.etaxonomy.taxeditor.bulkeditor.referencingobjects,
+ eu.etaxonomy.taxeditor.dataimport,
+ eu.etaxonomy.taxeditor.dataimport.wizard
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.ui.editors,
index eb3725ea16778b0d52083983a7bf147c19e86bec..8df35d12b1963c3ca040cb6c05ff8b56c99aabcf 100644 (file)
             id="nameeditor.editor"\r
             name="Name Editor">\r
       </editor>\r
+      <editor\r
+            class="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
+            default="false"\r
+            id="eu.etaxonomy.taxeditor.dataimport.DataImportEditor"\r
+            name="Data Import Editor">\r
+      </editor>\r
    </extension>\r
    <extension\r
          point="org.eclipse.ui.menus">\r
@@ -34,6 +40,9 @@
                id="bulkeditor.menus.openmenu"\r
                label="Bulk Editor">\r
          </menu>\r
+         <menu\r
+               label="Search Specimen">\r
+         </menu>\r
       </menuContribution>\r
       <menuContribution\r
             locationURI="menu:bulkeditor.menus.openmenu">\r
                style="push">\r
          </command>\r
       </menuContribution>\r
+      <menuContribution\r
+            allPopups="false"\r
+            locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
+         <command\r
+               commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
+               label="Add Derived Unit Media"\r
+               style="push">\r
+         </command>\r
+         <command\r
+               commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
+               label="Add Field Object Media"\r
+               style="push">\r
+         </command>\r
+      </menuContribution>\r
    </extension>\r
    <extension\r
          point="org.eclipse.ui.commands">\r
             id="bulkeditor.commands.removemergecandidate"\r
             name="Remove as Candidate for Group Merge">\r
       </command>\r
+      <command\r
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"\r
+            id="taxeditor-bulkeditor.command.setMarkerFlag"\r
+            name="Set Marker Flag">\r
+      </command>\r
+      <command\r
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddDerivedUnitMediaHandler"\r
+            id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
+            name="Add Derived Unit Media">\r
+      </command>\r
+      <command\r
+            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddFieldObjectMediaHandler"\r
+            id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
+            name="Add Field Object Media">\r
+      </command>\r
       <!--command\r
             defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.NewEntityHandler"\r
             id="eu.etaxonomy.taxeditor.bulkeditor.command.new"\r
             type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
       </propertyTester>\r
    </extension>\r
-   <extension\r
-         point="org.eclipse.ui.commands">\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.handler.SetMarkerFlagHandler"\r
-            id="taxeditor-bulkeditor.command.setMarkerFlag"\r
-            name="Set Marker Flag">\r
-      </command>\r
-   </extension>\r
    <extension\r
          point="org.eclipse.ui.handlers">\r
       <handler\r
             name="Bulk Editor">\r
       </page>\r
    </extension>\r
-   <extension\r
-         point="org.eclipse.ui.menus">\r
-      <menuContribution\r
-            allPopups="false"\r
-            locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
-               label="Add Derived Unit Media"\r
-               style="push">\r
-         </command>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
-               label="Add Field Object Media"\r
-               style="push">\r
-         </command>\r
-      </menuContribution>\r
-   </extension>\r
-   <extension\r
-         point="org.eclipse.ui.commands">\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddDerivedUnitMediaHandler"\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
-            name="Add Derived Unit Media">\r
-      </command>\r
-      <command\r
-            defaultHandler="eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AddFieldObjectMediaHandler"\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
-            name="Add Field Object Media">\r
-      </command>\r
-   </extension>\r
    <extension\r
          point="org.eclipse.core.expressions.propertyTesters">\r
       <propertyTester\r
                id="eu.etaxonomy.taxeditor.view.detail">\r
          </showInPart>\r
       </perspectiveExtension>\r
+   </extension>\r
+   <extension\r
+         point="org.eclipse.ui.importWizards">\r
+      <wizard\r
+            category="eu.etaxonomy.taxeditor.import.category.cdm"\r
+            class="eu.etaxonomy.taxeditor.dataimport.wizard.SpecimenSearchWizard"\r
+            id="eu.etaxonomy.taxeditor.dataimport.wizard.SpecimenSearchWizard"\r
+            name="Query BioCASE">\r
+      </wizard>\r
    </extension>
 <!-- start set marker -->\r
 \r
index 2bd124f21bf3a1739cc4428459b651ba34630e63..5261d35d7ec83f5a681224b2ced9d55549645d30 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.
 */
@@ -25,8 +25,9 @@ import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.texteditor.AbstractDocumentProvider;
 
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
+import eu.etaxonomy.taxeditor.dataimport.SpecimenEditorInput;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 
 
 
@@ -54,11 +55,11 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
        private LineAnnotationModel annotationModel;
 
        private IEntityCreator<?> entityCreator;
-       
+
        private ILineDisplayStrategy lineDisplayStrategy;
 
        private IEditorInput input;
-       
+
        /**
         * <p>Constructor for AnnotatedLineDocumentProvider.</p>
         *
@@ -67,12 +68,12 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
        public AnnotatedLineDocumentProvider(IEditorInput input){
                this.input = input;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public IAnnotationModel getAnnotationModel(Object element) {
                if (element == input) {
-                       
+
                        // Create model as necessary
                        if (annotationModel == null) {
                                annotationModel = new LineAnnotationModel(getLineDisplayStrategy(element));
@@ -80,10 +81,10 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                        }
                        return annotationModel;
                }
-               
+
                return null;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected IAnnotationModel createAnnotationModel(Object element)
@@ -96,28 +97,28 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
        public IDocument getDocument(Object element) {
                return document;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        protected IDocument createDocument(Object element) throws CoreException {
-               
+
                if (element instanceof IEditorInput) {
                        IEditorInput input = (IEditorInput) element;
                        document = new Document("");
 //                     IAnnotationModel model = getAnnotationModel(element);
-                                       
+
                        List<?> entityList = getEntityList(element);
-                       
+
                        if(entityList != null){
                                for (Object entity : entityList) {
                                        try {
                                                createAnnotatedLine(input, entity);
                                        } catch (BadLocationException e) {
-                                               BulkEditorUtil.error(getClass(), "Problems creating annotated line: ", e);
+                                               AbstractUtility.error(getClass(), "Problems creating annotated line: ", e);
                                        }
-                               }       
+                               }
                        }
-                       
+
                        return document;
                }
                return null;
@@ -132,12 +133,12 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
         * @return a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
         */
        protected LineAnnotation createAnnotatedLine(Object element, Object entity) throws BadLocationException {
-               
+
                Document document = (Document) getDocument(element);
                ILineDisplayStrategy lineDisplayStrategy = getLineDisplayStrategy(element);
-               
+
                LineAnnotation annotation = new LineAnnotation(entity, lineDisplayStrategy);
-                               
+
                // Is document zero length, or is last char in document line delimiter?
                int docLength = document.getLength();
                boolean useDelimiter = false;
@@ -149,7 +150,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                if (useDelimiter) {
                        document.replace(docLength, 0, document.getDefaultLineDelimiter());
                }
-               
+
                String text;
                if (lineDisplayStrategy.isEntityCacheEmpty(entity)) {
                        text = lineDisplayStrategy.getEmptyCacheMessage(entity);
@@ -159,46 +160,46 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                text += lineDisplayStrategy.getSupplementalText(entity);
                docLength = document.getLength();
                document.replace(docLength, 0, text);
-               
+
                Position position = new Position(docLength, text.length());
-               
+
                IAnnotationModel model = getAnnotationModel(element);
                if(model != null){
                        model.addAnnotation(annotation, position);
                }
-                                                       
-//             lineDisplayStrategy.addDisplayListener(entity, 
+
+//             lineDisplayStrategy.addDisplayListener(entity,
 //                                             new EntityListenerImpl((LineAnnotation) annotation, element));
-//                             
+//
                return annotation;
        }
-       
-       
+
+
        /**
         * <p>updateLineFromAnnotation</p>
         *
         * @param annotation a {@link eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotation} object.
         */
        public void updateLineFromAnnotation(LineAnnotation annotation) {
-                               
+
                IAnnotationModel model = getAnnotationModel(input);
                IDocument document = getDocument(input);
                ILineDisplayStrategy lineDisplay = getLineDisplayStrategy(input);
-               
+
                Object entity = annotation.getEntity();
                String text = "";
                if (getLineDisplayStrategy(input).isEntityCacheEmpty(entity)) {
                        text = lineDisplay.getEmptyCacheMessage(entity);
                } else {
                        text = lineDisplay.getText(entity);
-               }               
+               }
                text += lineDisplay.getSupplementalText(entity);
-               
+
                try {
                        if (model.getPosition(annotation) == null) {
                                return;
                        }
-                       int offset = model.getPosition(annotation).getOffset();                 
+                       int offset = model.getPosition(annotation).getOffset();
                        int line = document.getLineOfOffset(offset);
                        int lineLength = document.getLineLength(document.getLineOfOffset(offset));
                        if (document.getLineDelimiter(line) != null) {
@@ -206,18 +207,21 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                        }
                        document.replace(offset, lineLength, text);
                } catch (BadLocationException e) {
-                       BulkEditorUtil.error(getClass(), "Problem updating annotated line: " ,e);
+                       AbstractUtility.error(getClass(), "Problem updating annotated line: " ,e);
                }
        }
-       
+
        /**
-        * @param element 
+        * @param element
         * @return
         */
        private List<?> getEntityList(Object element) {
                if (element instanceof AbstractBulkEditorInput) {
                        return ((AbstractBulkEditorInput)element).getModel();
                }
+               else if(element instanceof SpecimenEditorInput){
+                   return ((SpecimenEditorInput) element).getResults();
+               }
                return null;
        }
 
@@ -226,9 +230,9 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
        protected void doSaveDocument(IProgressMonitor monitor, Object element,
                        IDocument document, boolean overwrite) throws CoreException {
                if (element instanceof AbstractBulkEditorInput) {
-                       
+
                        IEntityPersistenceService persistenceService = (AbstractBulkEditorInput) element;
-                       
+
                        // Get new containers from annotation model
                        LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(element);
                        Iterator iterator = model.getAnnotationIterator();
@@ -248,7 +252,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                                        continue;
                                }
                                if (annotation.isMarkedAsMerged()) {
-                                       persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); //  merge                                        
+                                       persistenceService.merge(annotation.getEntity(), annotation.getMergeTarget()); //  merge
                                } else {
                                        // TODO clarify w AM whether this needs to be executed on merged objects
                                        //persistenceService.delete(annotation.getEntity()); // delete
@@ -263,20 +267,20 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
        protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
                return null;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public boolean isModifiable(Object element) {
                return true;
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public boolean isReadOnly(Object element) {
                // enables copy & paste
                return false;
        }
-       
+
        /**
         * <p>Getter for the field <code>entityCreator</code>.</p>
         *
@@ -300,9 +304,9 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                        ILineDisplayStrategy lineDisplayStrategy, Object element) {
                if (element instanceof IEditorInput) {
                        this.lineDisplayStrategy = lineDisplayStrategy;
-               }       
+               }
        }
-       
+
        /**
         * <p>Getter for the field <code>lineDisplayStrategy</code>.</p>
         *
@@ -316,7 +320,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                }
                return null;
        }
-       
+
        /**
         * <p>removeAnnotatedLine</p>
         *
@@ -326,7 +330,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotation(entity);
                removeAnnotatedLine(annotation);
        }
-       
+
        /**
         * <p>removeAnnotatedLine</p>
         *
@@ -337,7 +341,7 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                LineAnnotation annotation = (LineAnnotation) annotationModel.getAnnotationAtLine(lineno, document);
                removeAnnotatedLine(annotation);
        }
-       
+
        /**
         * <p>removeAnnotatedLine</p>
         *
@@ -347,15 +351,15 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                if (annotation != null) {
                        Document document = (Document) getDocument(input);
                        LineAnnotationModel model = (LineAnnotationModel) getAnnotationModel(input);
-                       
+
                        Position position = model.getPosition(annotation);
                        int offset = position.getOffset();
                        int length = position.getLength();
-                       
+
                        Object entity = annotation.getEntity();
                        annotation.markAsDeleted();
                        model.removeAnnotation(annotation);
-                       
+
                        // Immediately followed by a delimiter?
                        int annotationEnd = offset + length;
                        try {
@@ -363,17 +367,17 @@ public class AnnotatedLineDocumentProvider extends AbstractDocumentProvider {
                                        length += 2;
                                }
                        } catch (BadLocationException e1) {
-                               BulkEditorUtil.error(getClass(), "Problems removing annotated line", e1);
+                               AbstractUtility.error(getClass(), "Problems removing annotated line", e1);
                        }
-                       
+
                        try {
                                document.replace(offset, length, "");
                        } catch (BadLocationException e) {
-                               BulkEditorUtil.error(getClass(), "Problems removing annotated line", e);
+                               AbstractUtility.error(getClass(), "Problems removing annotated line", e);
                        }
-               }               
+               }
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#changed(java.lang.Object)
         */
index e0c5d808d1405944167d161b0819bdc6fff3a755..5048cf7fb8abebe0645afd1b0488653b7427b00d 100644 (file)
@@ -1,17 +1,15 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor.bulkeditor;
 
-import java.util.Iterator;
-
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.dialogs.MessageDialogWithToggle;
@@ -21,7 +19,6 @@ import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.TextSelection;
 import org.eclipse.jface.text.source.Annotation;
 import org.eclipse.jface.text.source.AnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModel;
 import org.eclipse.jface.text.source.ISourceViewer;
 import org.eclipse.jface.text.source.IVerticalRuler;
 import org.eclipse.jface.util.IPropertyChangeListener;
@@ -46,6 +43,7 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -62,9 +60,9 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
        public static final String ID = "bulkeditor.editor";
 
        private boolean isInitialFocus = true;
-       
+
        private BulkEditorSearch searchBar = null;
-       
+
        private IPropertyChangeListener markerPreferenceListener;
 
        /**
@@ -81,32 +79,33 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
        @Override
        protected void initializeEditor() {
                super.initializeEditor();
-                               
+
                /**
                 * see AbstractTextEditor javadoc for explanation of context menu ids
                 */
                setEditorContextMenuId("#BulkEditorContext");
 
 //             setEntityCreatorService(new BulkEditorEntityCreatorService());
-               
+
                setLineDisplayStrategy(new BulkEditorLineDisplay(this));
-               
+
                setSourceViewerConfiguration(new BulkEditorViewerConfiguration(lineDisplayStrategy));
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.ListEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int)
         */
        /** {@inheritDoc} */
-       protected ISourceViewer createSourceViewer(Composite parent,
+       @Override
+    protected ISourceViewer createSourceViewer(Composite parent,
                        IVerticalRuler ruler, int styles) {
                ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles);
-               if (((AbstractBulkEditorInput) getEditorInput()).isMergingEnabled()) {
+               if (getEditorInput().isMergingEnabled()) {
                        addToggleMergeCandidateListener(ruler.getControl());
                }
                return viewer;
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.bulkeditor.AnnotatedLineEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
         */
@@ -114,46 +113,46 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
        @Override
        public void init(IEditorSite site, IEditorInput input)
                        throws PartInitException {
-               
+
                if (!(input instanceof AbstractBulkEditorInput)) {
                        throw new PartInitException("Invalid Input: Must be BulkEditorInput");
                }
-               
+
                super.init(site, input);
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
         */
        /** {@inheritDoc} */
        @Override
        public void createPartControl(Composite parent) {
-               
+
                parent.setLayout(new GridLayout());
-               
+
                Composite layoutComposite = new Composite(parent, SWT.NONE);
                layoutComposite.setLayout(new GridLayout());
 
                GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false);
                layoutComposite.setLayoutData(gridData);
-               
+
 //             layoutComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
-               
-               
+
+
                searchBar = new BulkEditorSearch(this, layoutComposite, SWT.NONE);
 //             layoutComposite.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
-                               
+
                super.createPartControl(parent);
-               
+
                // Set viewer composite to fill grid. Unfortunately it is private and we have to do a little hack here.
                for (Control control : parent.getChildren()) {
-                       if (control instanceof Composite && 
+                       if (control instanceof Composite &&
                                                !(control.equals(layoutComposite))) {
                                control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                        }
                }
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.ui.editors.text.TextEditor#dispose()
         */
@@ -183,32 +182,32 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
        public void setFocus() {
                searchBar.setFocus();
 
-               // TODO find a better place to put this - this dialog should be shown after initial contents of 
+               // TODO find a better place to put this - this dialog should be shown after initial contents of
                //      Editor are displayed
                if (isInitialFocus) {
                        displayWarningDialog();
                        isInitialFocus = false;
                }
        }
-       
+
        /**
-        * 
+        *
         */
        private void displayWarningDialog() {
                IPreferenceStore prefs = PreferencesUtil.getPreferenceStore();
-               if (!prefs.getBoolean(PreferencesUtil.HIDE_BULKEDITOR_INFO)) {
+               if (!prefs.getBoolean(IPreferenceKeys.HIDE_BULKEDITOR_INFO)) {
                        String msg = "The Bulk Editor allows you to edit objects used to reference other objects, such as names, references, and authors.\n\n" +
                                                        "Any changes you make to an object in the Bulk Editor will be displayed wherever the object is used.\n\n" +
                                                        "For instance, a reference may be displayed with both a name and a descriptive element. If the reference name is changed here, the display of both the name and the descriptive element will be affected.";
                        MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm
-                                                                                               (getSite().getShell(), "Bulk Editor", msg, "Do not show this message again", 
-                                                                                                               false, null, PreferencesUtil.HIDE_BULKEDITOR_INFO);
-                       if (dialog.getReturnCode() == Window.OK) { 
-                               prefs.setValue(PreferencesUtil.HIDE_BULKEDITOR_INFO, dialog.getToggleState());
+                                                                                               (getSite().getShell(), "Bulk Editor", msg, "Do not show this message again",
+                                                                                                               false, null, IPreferenceKeys.HIDE_BULKEDITOR_INFO);
+                       if (dialog.getReturnCode() == Window.OK) {
+                               prefs.setValue(IPreferenceKeys.HIDE_BULKEDITOR_INFO, dialog.getToggleState());
                        }
                }
        }
-       
+
        /**
         * @param control
         */
@@ -229,14 +228,14 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
         * @param line a int.
         */
        public void toggleMergeCandidateAnnotation(int line) {
-               
+
                IDocument document = getSourceViewer().getDocument();
-               LineAnnotationModel model = 
+               LineAnnotationModel model =
                                (LineAnnotationModel) getSourceViewer().getAnnotationModel();
-               
+
                if(model != null){
                        Annotation annotation = model.getAnnotationAtLine(line, document);
-                       
+
                        if (annotation != null) {
                                if (annotation.getType().equals(IBulkEditorConstants.TYPE_MERGE_CANDIDATE)) {
                                        model.changeAnnotationType(
@@ -248,25 +247,26 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                        }
                }
        }
-       
+
        /** {@inheritDoc} */
-       public void changed(Object object) {
+       @Override
+    public void changed(Object object) {
 //             this.dirty = dirty;
                AnnotatedLineDocumentProvider p = (AnnotatedLineDocumentProvider) getDocumentProvider();
                p.changed(object);
 //             firePropertyChange(PROP_DIRTY);
        }
-       
+
        /* (non-Javadoc)
         * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
         */
        /** {@inheritDoc} */
        public void performSearch(BulkEditorQuery query) {
                if (query != null) {
-                       
+
                        // TODO check if dirty, prompt save
                        if (isDirty()) {
-                               boolean proceed = MessageDialog.openQuestion(getEditorSite().getShell(), 
+                               boolean proceed = MessageDialog.openQuestion(getEditorSite().getShell(),
                                                "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
                                if (proceed) {
                                        doSave(null);
@@ -274,40 +274,41 @@ public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDe
                                        return;
                                }
                        }
-                                               
+
                        getEditorInput().performSearch(query);
-                       
+
                        refresh();
-                       
+
                        selectFirstItem();
-                       
+
                        getSourceViewer().getTextWidget().setFocus();
                }
        }
-       
+
        private void selectFirstItem() {
-               ITextSelection selection = new TextSelection(0, 0);     
+               ITextSelection selection = new TextSelection(0, 0);
                getSelectionProvider().setSelection(selection);
        }
 
        /**
-        * 
+        *
         */
        public void refresh() {
                if(getDocumentProvider().getAnnotationModel(getEditorInput()) != null){
                        ((AnnotationModel) getDocumentProvider().getAnnotationModel(getEditorInput())).removeAllAnnotations();
                }
-               
+
                setInput(getEditorInput());
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public AbstractBulkEditorInput getEditorInput() {
                return (AbstractBulkEditorInput) super.getEditorInput();
        }
-       
-       protected void editorContextMenuAboutToShow(IMenuManager menu) {
+
+       @Override
+    protected void editorContextMenuAboutToShow(IMenuManager menu) {
                super.editorContextMenuAboutToShow(menu);
                menu.remove(ITextEditorActionConstants.SHIFT_RIGHT);
                menu.remove(ITextEditorActionConstants.SHIFT_LEFT);
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditor.java
new file mode 100644 (file)
index 0000000..5ca06d9
--- /dev/null
@@ -0,0 +1,45 @@
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.AnnotatedLineEditor;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class DataImportEditor extends AnnotatedLineEditor {
+
+    /** Constant <code>ID="bulkeditor.input.nameRelationship"</code> */
+    public static final String ID = "eu.etaxonomy.taxeditor.dataimport.DataImportEditor";
+
+    /**
+     * Constructs a new DataImportEditor with a new {@link ConversationHolder}
+     */
+    public DataImportEditor() {
+        super(null);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor()
+     */
+    /** {@inheritDoc} */
+    @Override
+    protected void initializeEditor() {
+        super.initializeEditor();
+        String editorTitle = "Data Import Editor";
+        setPartName(editorTitle);
+        setTitleToolTip(editorTitle);
+        setLineDisplayStrategy(new DataImportEditorLineDisplayStrategy());
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/DataImportEditorLineDisplayStrategy.java
new file mode 100644 (file)
index 0000000..00929be
--- /dev/null
@@ -0,0 +1,124 @@
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener;
+import eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class DataImportEditorLineDisplayStrategy implements ILineDisplayStrategy {
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getIndent(java.lang.Object)
+     */
+    @Override
+    public int getIndent(Object entity) {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getIcon(java.lang.Object)
+     */
+    @Override
+    public Image getIcon(Object entity) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getFont(java.lang.Object)
+     */
+    @Override
+    public Font getFont(Object entity) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getText(java.lang.Object)
+     */
+    @Override
+    public String getText(Object entity) {
+        return ((SpecimenOrObservationBase)entity).getTitleCache();
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getSupplementalText(java.lang.Object)
+     */
+    @Override
+    public String getSupplementalText(Object entity) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getEmptyCacheMessage(java.lang.Object)
+     */
+    @Override
+    public String getEmptyCacheMessage(Object entity) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#setText(java.lang.String, java.lang.Object)
+     */
+    @Override
+    public void setText(String text, Object entity) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#getHoverText(java.lang.Object)
+     */
+    @Override
+    public String getHoverText(Object entity) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#setStatusMessage(java.lang.String, java.lang.Object)
+     */
+    @Override
+    public void setStatusMessage(String text, Object entity) {
+        // TODO Auto-generated method stub
+
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#isEntityCacheEmpty(java.lang.Object)
+     */
+    @Override
+    public boolean isEntityCacheEmpty(Object entity) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.annotatedlineeditor.ILineDisplayStrategy#addDisplayListener(java.lang.Object, eu.etaxonomy.taxeditor.annotatedlineeditor.EntityListener)
+     */
+    @Override
+    public void addDisplayListener(Object entity, EntityListener listener) {
+        // TODO Auto-generated method stub
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/SpecimenEditorInput.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/dataimport/SpecimenEditorInput.java
new file mode 100644 (file)
index 0000000..0674bf4
--- /dev/null
@@ -0,0 +1,95 @@
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport;
+
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+
+/**
+ * @author pplitzner
+ * @date 20.09.2013
+ *
+ */
+public class SpecimenEditorInput implements IEditorInput {
+
+    private List<SpecimenOrObservationBase> results;
+
+    /**
+     * @param results
+     */
+    public SpecimenEditorInput(List<SpecimenOrObservationBase> results) {
+        this.results = results;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+     */
+    @Override
+    public Object getAdapter(Class adapter) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#exists()
+     */
+    @Override
+    public boolean exists() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+     */
+    @Override
+    public ImageDescriptor getImageDescriptor() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getName()
+     */
+    @Override
+    public String getName() {
+        return "inputName";
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getPersistable()
+     */
+    @Override
+    public IPersistableElement getPersistable() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getToolTipText()
+     */
+    @Override
+    public String getToolTipText() {
+        return "tooltip";
+    }
+
+    /**
+     * @return the results
+     */
+    public List<SpecimenOrObservationBase> getResults() {
+        return results;
+    }
+
+}
@@ -7,22 +7,27 @@
 * 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.io.wizard.specimenSearch;
+package eu.etaxonomy.taxeditor.dataimport.wizard;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.http.client.ClientProtocolException;
+import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.ui.IImportWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.cdm.ext.biocase.BioCaseQuery;
 import eu.etaxonomy.cdm.ext.biocase.BioCaseQueryServiceWrapper;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.taxeditor.dataimport.DataImportEditor;
+import eu.etaxonomy.taxeditor.dataimport.SpecimenEditorInput;
 
 /**
  * @author pplitzner
@@ -30,6 +35,7 @@ import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
  *
  */
 public class SpecimenSearchWizard extends Wizard implements IImportWizard {
+    private static final Logger logger = Logger.getLogger(SpecimenSearchWizard.class);
 
     private BioCaseQueryServiceWrapper bioCaseQueryServiceWrapper;
     private BioCaseQuery query;
@@ -41,7 +47,7 @@ public class SpecimenSearchWizard extends Wizard implements IImportWizard {
     public SpecimenSearchWizard() {
         query = new BioCaseQuery();
         bioCaseQueryServiceWrapper = new BioCaseQueryServiceWrapper();
-        this.results = new ArrayList<SpecimenOrObservationBase>();
+        this.results = getResults();
     }
 
 
@@ -50,7 +56,16 @@ public class SpecimenSearchWizard extends Wizard implements IImportWizard {
      */
     @Override
     public boolean performFinish() {
-        return false;
+        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+
+        try {
+            SpecimenEditorInput input = new SpecimenEditorInput(results);
+            input.getToolTipText();
+            page.openEditor(input, DataImportEditor.ID, true);
+        } catch ( PartInitException e ) {
+            //Put your exception handler here if you wish to
+        }
+        return true;
     }
 
     /* (non-Javadoc)
@@ -59,7 +74,6 @@ public class SpecimenSearchWizard extends Wizard implements IImportWizard {
     @Override
     public void addPages() {
         addPage(new SpecimenSearchWizardPage("Specimen Search", results));
-        addPage(new SpecimenSearchResultWizardPage("Search Results", results));
     }
 
     public List<SpecimenOrObservationBase> getResults(){
@@ -7,7 +7,7 @@
 * 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.io.wizard.specimenSearch;
+package eu.etaxonomy.taxeditor.dataimport.wizard;
 
 import java.util.List;
 
index 58a2e84006f9814da95a040e6dedbf97ea8a0d55..223433f9fe6d512db7106c19605afb0edf27246e 100644 (file)
@@ -16,7 +16,6 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.handler,
  eu.etaxonomy.taxeditor.io,
  eu.etaxonomy.taxeditor.io.wizard,
- eu.etaxonomy.taxeditor.io.wizard.specimenSearch,
  eu.etaxonomy.taxeditor.labels,
  eu.etaxonomy.taxeditor.model;uses:="eu.etaxonomy.cdm.model.common,eu.etaxonomy.cdm.model.name,eu.etaxonomy.cdm.model.taxon",
  eu.etaxonomy.taxeditor.newWizard,
@@ -31,6 +30,7 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.store.internal,
  eu.etaxonomy.taxeditor.store.operations,
  eu.etaxonomy.taxeditor.ui.bar,
+ eu.etaxonomy.taxeditor.ui.campanula.specimenSearch,
  eu.etaxonomy.taxeditor.ui.combo,
  eu.etaxonomy.taxeditor.ui.dialog,
  eu.etaxonomy.taxeditor.ui.dialog.selection,
index eaf2742d2590371b6bae8c228a9dc7a135c02be3..0f385a5af4379ea0d8e7284f951117b331af9ada 100644 (file)
             id="eu.etaxonomy.taxeditor.io.import.specimenCdmExcel"
             name="Specimen CDM Excel">
       </wizard>
-      <wizard
-            category="eu.etaxonomy.taxeditor.import.category.cdm"
-            class="eu.etaxonomy.taxeditor.io.wizard.specimenSearch.SpecimenSearchWizard"
-            id="eu.etaxonomy.taxeditor.io.wizard.specimenSearch.SpecimenSearchWizard"
-            name="Specimen Search">
-      </wizard>
    </extension>
    <extension
          point="org.eclipse.ui.exportWizards">
index a95f420f0d9e51db7eb4495daec89fa5800bb5d4..acab4046c1c0c607f17ce36e2c891655d0e6f155 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.
 */
@@ -30,7 +30,7 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
 
        private Abcd206ImportConfigurator configurator;
        private ImportFromFileDataSourceWizardPage dataSourcePage;
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
         */
@@ -47,23 +47,25 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
        @Override
        public boolean performFinish() {
                URI source = dataSourcePage.getUri();
+//             InputStream inputStream = new FileInputStream(new File(source));
                configurator.setSource(source);
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-               
+
                CdmStore.getImportManager().run(configurator);
                return true;
-               
+
        }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        /** {@inheritDoc} */
-       public void init(IWorkbench workbench, IStructuredSelection selection) {
+       @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
                super.init(workbench, selection);
                configurator =  CdmStore.getImportManager().AbcdConfigurator();
        }
-       
+
        /* (non-Javadoc)
         * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
         */
@@ -71,7 +73,7 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
        @Override
        public void addPages() {
                super.addPages();
-               
+
                dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
                addPage(dataSourcePage);
        }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchResultWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/specimenSearch/SpecimenSearchResultWizardPage.java
deleted file mode 100644 (file)
index c1cf37f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2013 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.io.wizard.specimenSearch;
-
-import java.util.List;
-
-import org.eclipse.jface.dialogs.IPageChangedListener;
-import org.eclipse.jface.dialogs.PageChangedEvent;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.ui.campanula.specimenSearch.SpecimenSearchResultsController;
-
-/**
- * @author pplitzner
- * @date 12.09.2013
- *
- */
-public class SpecimenSearchResultWizardPage extends WizardPage implements IPageChangedListener {
-
-    private SpecimenSearchResultsController specimenSearchResultsController;
-    private List<SpecimenOrObservationBase> results;
-
-    /**
-     * @param pageName
-     */
-    protected SpecimenSearchResultWizardPage(String pageName, List<SpecimenOrObservationBase> results) {
-        super(pageName);
-        this.results = results;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-     */
-    @Override
-    public void createControl(Composite parent) {
-        specimenSearchResultsController = new SpecimenSearchResultsController(parent);
-        setControl(specimenSearchResultsController.getComposite());
-    }
-
-    @Override
-    public void setVisible(boolean visible) {
-        super.setVisible(visible);
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.dialogs.IPageChangedListener#pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
-     */
-    @Override
-    public void pageChanged(PageChangedEvent event) {
-        if(isCurrentPage()){
-            if(results!=null && !results.isEmpty()){
-                specimenSearchResultsController.setText(results.get(0).getTitleCache());
-            }
-        }
-    };
-}
index f4131c50bd53d97adb77a96fdb839f3ff5916ce9..22c34391ec7d06f4c9c5fda8ce4f1d12b691e8c4 100644 (file)
@@ -16,7 +16,6 @@ import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.ui.campanula.basicFields.ComboDefinedTermController;
 import eu.etaxonomy.taxeditor.ui.campanula.basicFields.EntitySelectionFieldController;
 import eu.etaxonomy.taxeditor.ui.campanula.basicFields.TextFieldController;
 import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
@@ -37,7 +36,7 @@ public class DerivedUnitDetailsElementController extends AbstractCdmDetailElemen
 
     private TextFieldController barCode;
     private TextFieldController catalogNumber;
-    private ComboDefinedTermController<PreservationMethod> preservationMethod;
+//    private ComboDefinedTermController<PreservationMethod> preservationMethod;
     private EntitySelectionFieldController<TaxonNameBase> storedUnder;
     private TextFieldController exsiccatum;
 
@@ -66,7 +65,7 @@ public class DerivedUnitDetailsElementController extends AbstractCdmDetailElemen
             AbstractUtility.info(e.getMessage());
             entityPreservationMethod = null;
         }
-        preservationMethod = new ComboDefinedTermController<PreservationMethod>(derivedUnitDetailsElement.getComboPreservationMethod(), getFormFactory(), formElement, PreservationMethod.class, entityPreservationMethod, style);
+//        preservationMethod = new ComboDefinedTermController<PreservationMethod>(derivedUnitDetailsElement.getComboPreservationMethod(), getFormFactory(), formElement, PreservationMethod.class, entityPreservationMethod, style);
         storedUnder = new EntitySelectionFieldController<TaxonNameBase>(derivedUnitDetailsElement.getStoredUnderSelectionField(), getFormFactory(), getConversationHolder(), formElement, TaxonNameBase.class, entity.getStoredUnder(), EntitySelectionElement.ALL);
         String entitiyExsiccatum;
         try {
@@ -92,12 +91,12 @@ public class DerivedUnitDetailsElementController extends AbstractCdmDetailElemen
             getEntity().setBarcode(barCode.getText());
         } else if (eventSource == catalogNumber) {
             getEntity().setCatalogNumber(catalogNumber.getText());
-        } else if (eventSource == preservationMethod) {
-            try {
-                getEntity().setPreservationMethod(preservationMethod.getSelection());
-            } catch (MethodNotSupportedByDerivedUnitTypeException e) {
-                AbstractUtility.errorDialog("MethodNotSupportedByDerivedUnitTypeException", this, "MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit", e);
-            }
+//        } else if (eventSource == preservationMethod) {
+//            try {
+//                getEntity().setPreservationMethod(preservationMethod.getSelection());
+//            } catch (MethodNotSupportedByDerivedUnitTypeException e) {
+//                AbstractUtility.errorDialog("MethodNotSupportedByDerivedUnitTypeException", this, "MethodNotSupportedByDerivedUnitTypeException when trying to set preservation method for derive unit", e);
+//            }
         } else if (eventSource == storedUnder) {
             getEntity().setStoredUnder(storedUnder.getEntity());
         } else if (eventSource == exsiccatum) {