commit 6484f4e1050e03afb138bcf0651ba982221e8609
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Mon Oct 26 18:21:08 2015 +0100

    Removed OccurrenceView

diff --git a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/DerivatePerspective.java b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/DerivatePerspective.java
index bbd88abc2..1033f0c7c 100644
--- a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/DerivatePerspective.java
+++ b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/DerivatePerspective.java
@@ -13,10 +13,10 @@ import org.eclipse.ui.IPageLayout;
 import org.eclipse.ui.IPlaceholderFolderLayout;
 import org.eclipse.ui.progress.IProgressConstants;
 
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart;
 import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator;
 import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart;
-import eu.etaxonomy.taxeditor.view.derivative.OccurrenceView;
 import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart;
 
 /**
@@ -36,7 +36,7 @@ public class DerivatePerspective extends Default {
 
         layout.addView(DetailsViewPart.ID, IPageLayout.RIGHT, 0.6f, layout.getEditorArea());
 
-        layout.addView(OccurrenceView.ID, IPageLayout.BOTTOM, 0.5f, layout.getEditorArea());
+        layout.addView(DerivateView.ID, IPageLayout.BOTTOM, 0.5f, layout.getEditorArea());
 
         layout.addView(DescriptiveViewPart.ID, IPageLayout.BOTTOM, 0.6f, TaxonNavigator.ID);
 
diff --git a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
index 666680ec6..b41d0021e 100644
--- a/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
+++ b/eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Export-Package: eu.etaxonomy.taxeditor.editor,
  eu.etaxonomy.taxeditor.editor.name.operation,
  eu.etaxonomy.taxeditor.editor.view.concept,
  eu.etaxonomy.taxeditor.editor.view.dataimport,
+ eu.etaxonomy.taxeditor.editor.view.derivate,
  eu.etaxonomy.taxeditor.editor.view.descriptive,
  eu.etaxonomy.taxeditor.editor.view.media,
  eu.etaxonomy.taxeditor.editor.view.uses
diff --git a/eu.etaxonomy.taxeditor.editor/plugin.xml b/eu.etaxonomy.taxeditor.editor/plugin.xml
index 18537cde8..90e7ec540 100644
--- a/eu.etaxonomy.taxeditor.editor/plugin.xml
+++ b/eu.etaxonomy.taxeditor.editor/plugin.xml
@@ -390,7 +390,8 @@
             </visibleWhen>
          </command>
          <separator
-               name="eu.etaxonomy.taxeditor.editor.separator1">
+               name="eu.etaxonomy.taxeditor.editor.separator1"
+               visible="true">
          </separator>
       </menuContribution>
       <menuContribution
diff --git a/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
index c51b739fb..06ed980ec 100644
--- a/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
+++ b/eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF
@@ -53,7 +53,6 @@ Export-Package: eu.etaxonomy.cdm,
  eu.etaxonomy.taxeditor.view.datasource,
  eu.etaxonomy.taxeditor.view.datasource.handler,
  eu.etaxonomy.taxeditor.view.derivateSearch,
- eu.etaxonomy.taxeditor.view.derivative,
  eu.etaxonomy.taxeditor.view.detail,
  eu.etaxonomy.taxeditor.view.specimenSearch,
  eu.etaxonomy.taxeditor.view.supplementaldata,
diff --git a/eu.etaxonomy.taxeditor.store/plugin.xml b/eu.etaxonomy.taxeditor.store/plugin.xml
index 97507fd39..8e7a4532b 100644
--- a/eu.etaxonomy.taxeditor.store/plugin.xml
+++ b/eu.etaxonomy.taxeditor.store/plugin.xml
@@ -270,12 +270,6 @@
         id="eu.etaxonomy.taxeditor.view.sessions.SessionsViewPart"
         name="Sessions"
         restorable="false">
-  </view>
-  <view
-        class="eu.etaxonomy.taxeditor.view.derivative.OccurrenceView"
-        id="eu.etaxonomy.taxeditor.view.derivative.OccurrenceView"
-        name="Derivative Editor (taxon-based)"
-        restorable="true">
   </view>
    </extension>
    <extension
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivative/OccurrenceView.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivative/OccurrenceView.java
deleted file mode 100644
index 5ac2313a5..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivative/OccurrenceView.java
+++ /dev/null
@@ -1,192 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 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.view.derivative;
-
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.ISaveablePart2;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchPart;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.view.AbstractCdmViewPart;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateContentProvider;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
-
-/**
- * @author pplitzner
- * @date Oct 7, 2015
- *
- */
-public class OccurrenceView extends AbstractCdmViewPart implements IPartContentHasDetails, ISaveablePart2{
-
-    public static String ID = "eu.etaxonomy.taxeditor.view.derivative.OccurrenceView";
-
-    private TreeViewer viewer;
-    private DerivateContentProvider contentProvider;
-    private DerivateLabelProvider labelProvider;
-
-    private ISelectionService selectionService;
-
-    private ConversationHolder conversation;
-
-    private boolean dirty;
-
-
-    public OccurrenceView() {
-        if(conversation==null && CdmStore.isActive()){
-            conversation = CdmStore.createConversation();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void createPartControl(Composite parent) {
-
-        //listen to selection changes
-        selectionService = getSite().getWorkbenchWindow().getSelectionService();
-        selectionService.addSelectionListener(this);
-
-      //---tree viewer---
-        viewer = new TreeViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION));
-        GridData gridDataTree = new GridData();
-        gridDataTree.horizontalAlignment = GridData.FILL;
-        gridDataTree.verticalAlignment = GridData.FILL;
-        gridDataTree.grabExcessVerticalSpace = true;
-        gridDataTree.grabExcessHorizontalSpace = true;
-        viewer.getTree().setLayoutData(gridDataTree);
-        contentProvider = new DerivateContentProvider();
-        viewer.setContentProvider(contentProvider);
-        labelProvider = new DerivateLabelProvider();
-        viewer.setLabelProvider(labelProvider);
-        viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
-        // Propagate selection from viewer
-        getSite().setSelectionProvider(viewer);
-
-        //create context menu
-        MenuManager menuManager = new MenuManager();
-        getSite().registerContextMenu(menuManager, viewer);
-        Control control = viewer.getControl();
-        Menu menu = menuManager.createContextMenu(control);
-        control.setMenu(menu);
-
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setFocus() {
-        if(!conversation.isBound()){
-            conversation.bind();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void dispose() {
-        selectionService.removeSelectionListener(this);
-        if(conversation!=null){
-            conversation.close();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-        if(selection instanceof IStructuredSelection){
-            Object selectedElement = ((IStructuredSelection) selection).getFirstElement();
-            if(selectedElement instanceof Taxon){
-                Collection<SpecimenOrObservationBase> fieldUnits = CdmStore.getService(IOccurrenceService.class).listFieldUnitsByAssociatedTaxon((Taxon) selectedElement, null, null);
-                viewer.setInput(fieldUnits);
-            }
-        }
-    }
-
-    @Override
-    public boolean onComplete() {
-        return false;
-    }
-
-    @Override
-    public Viewer getViewer() {
-        return viewer;
-    }
-
-    @Override
-    public void createViewer(Composite parent) {
-    }
-
-    @Override
-    public void changed(Object object) {
-        this.dirty = true;
-        firePropertyChange(PROP_DIRTY);
-    }
-
-    @Override
-    public void doSave(IProgressMonitor monitor) {
-        if(conversation.isBound()){
-//            input.merge(); TODO remote merging
-            conversation.commit(true);
-        }
-        this.dirty = false;
-        firePropertyChange(PROP_DIRTY);
-    }
-
-    @Override
-    public void doSaveAs() {
-        doSave(new NullProgressMonitor());
-    }
-
-    @Override
-    public boolean isDirty() {
-        return this.dirty;
-    }
-
-    @Override
-    public boolean isSaveAsAllowed() {
-        return false;
-    }
-
-    @Override
-    public boolean isSaveOnCloseNeeded() {
-        return isDirty();
-    }
-
-    @Override
-    public int promptToSaveOnClose() {
-        return ISaveablePart2.DEFAULT;
-    }
-}
