commit 06aef3d44b4f16a68aae3fc78554cacea0c1babd
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Fri May 4 15:52:51 2018 +0200

    ref #6913 Remove graph key editor

diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/AbstractGraphKeyEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/AbstractGraphKeyEditor.java
deleted file mode 100644
index 81d5fe543..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/AbstractGraphKeyEditor.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/**
- *
- */
-package eu.etaxonomy.taxeditor.editor.key;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.zest.core.viewers.AbstractZoomableViewer;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.viewers.IZoomableWorkbenchPart;
-import org.eclipse.zest.core.viewers.ZoomContributionViewItem;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutAlgorithm;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
-
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.IIdentificationKey;
-import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-
-/**
- * @author n.hoffmann
- *
- */
-public abstract class AbstractGraphKeyEditor<T extends IIdentificationKey>
-		extends EditorPart implements IConversationEnabled,
-		IZoomableWorkbenchPart, IPostOperationEnabled,
-		IDirtyMarkable {
-
-	private CdmFormFactory formFactory;
-	private Composite container;
-	protected GraphViewer viewer;
-
-	private LayoutAlgorithm layoutAlgoritm;
-	private ZoomContributionViewItem zoomContributionViewItem;
-
-	private boolean dirty = false;
-	private IToolBarManager toolBarManager;
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.
-	 * IProgressMonitor)
-	 */
-	@Override
-	public void doSave(IProgressMonitor monitor) {
-		getConversationHolder().commit(true);
-		setDirty(false);
-		viewer.refresh();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
-	 */
-	@Override
-	public void doSaveAs() {
-		doSave(null);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite,
-	 * org.eclipse.ui.IEditorInput)
-	 */
-	@Override
-	public void init(IEditorSite site, IEditorInput input)
-			throws PartInitException {
-		setSite(site);
-		setInput(input);
-//		formFactory = new CdmFormFactory(site.getShell().getDisplay());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#isDirty()
-	 */
-	@Override
-	public boolean isDirty() {
-		return dirty;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
-	 */
-	@Override
-	public boolean isSaveAsAllowed() {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
-	 * .Composite)
-	 */
-	@Override
-	public void createPartControl(Composite parent) {
-		container = formFactory.createComposite(parent);
-
-		container.setLayout(new FillLayout());
-		viewer = new GraphViewer(container, SWT.NONE);
-		getSite().setSelectionProvider(viewer);
-
-		viewer.setContentProvider(getContentProvider());
-		viewer.setLabelProvider(getLabelProvider());
-
-		viewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
-
-		viewer.setLayoutAlgorithm(getLayoutAlgoritm(), false);
-
-		createMenu();
-
-		createToolbar();
-
-		viewer.setInput(getKey());
-
-		container.addControlListener(new ControlListener() {
-
-			@Override
-			public void controlResized(ControlEvent e) {
-				// applyLayout();
-			}
-
-			@Override
-			public void controlMoved(ControlEvent e) {
-				// TODO Auto-generated method stub
-
-			}
-		});
-	}
-
-	private void createToolbar() {
-		getToolBarManager().add(getZoomContributionViewItem());
-	}
-
-	private void createMenu() {
-		// Add context menu to tree
-		MenuManager menuMgr = new MenuManager();
-		menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
-		// MenuManager zoomMenu = new MenuManager("Zoom");
-		// zoomMenu.add(getZoomContributionViewItem());
-
-		ZoomContributionViewItem zoomItem = getZoomContributionViewItem();
-		menuMgr.add(zoomItem);
-		getSite().registerContextMenu(menuMgr, viewer);
-
-		Control control = viewer.getGraphControl();
-		Menu menu = menuMgr.createContextMenu(control);
-
-		control.setMenu(menu);
-
-	}
-
-	protected abstract IBaseLabelProvider getLabelProvider();
-
-	protected abstract IContentProvider getContentProvider();
-
-	/**
-	 * Return the key that this editor
-	 *
-	 * @return
-	 */
-	public abstract T getKey();
-
-	@Override
-	public void setFocus() {
-		viewer.getControl().setFocus();
-	}
-
-	public void refresh() {
-		viewer.refresh();
-		// graphViewer.applyLayout();
-	}
-
-	@Override
-	public void update(CdmDataChangeMap changeEvents) {
-
-	}
-
-	@Override
-	public AbstractZoomableViewer getZoomableViewer() {
-		return viewer;
-	}
-
-	private LayoutAlgorithm getLayoutAlgoritm() {
-		if (layoutAlgoritm == null) {
-			// layoutAlgoritm = new CompositeLayoutAlgorithm(
-			// LayoutStyles.NO_LAYOUT_NODE_RESIZING,
-			// new LayoutAlgorithm[] {
-			// new TreeLayoutAlgorithm(
-			// LayoutStyles.NO_LAYOUT_NODE_RESIZING),
-			// new HorizontalShift(
-			// LayoutStyles.NO_LAYOUT_NODE_RESIZING) });
-
-			layoutAlgoritm = new TreeLayoutAlgorithm(
-					LayoutStyles.NO_LAYOUT_NODE_RESIZING);
-			layoutAlgoritm.setEntityAspectRatio(0.5);
-		}
-		return layoutAlgoritm;
-	}
-
-	private ZoomContributionViewItem getZoomContributionViewItem() {
-		if (zoomContributionViewItem == null) {
-			zoomContributionViewItem = new ZoomContributionViewItem(this);
-		}
-		return new ZoomContributionViewItem(this);
-	}
-
-	@Override
-	public boolean postOperation(CdmBase objectAffectedByOperation) {
-		setDirty(true);
-		refresh();
-
-		if (objectAffectedByOperation instanceof PolytomousKeyNode) {
-			viewer.setSelection(new StructuredSelection(
-					objectAffectedByOperation), true);
-		}
-
-		return true;
-	}
-
-	private IToolBarManager getToolBarManager() {
-		if (toolBarManager == null) {
-			toolBarManager = getEditorSite().getActionBars()
-					.getToolBarManager();
-		}
-		return toolBarManager;
-	}
-
-	public void applyLayout() {
-		viewer.applyLayout();
-	}
-
-	@Override
-	public boolean onComplete() {
-		return true;
-	}
-
-	public void setDirty(boolean dirty) {
-		this.dirty = dirty;
-		firePropertyChange(PROP_DIRTY);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
-	 * java.lang.Object)
-	 */
-	@Override
-	public void changed(Object element) {
-		setDirty(true);
-		viewer.update(element, null);
-	}
-
-	/* (non-Javadoc)
-	 * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
-	 */
-	@Override
-	public void forceDirty() {
-	    changed(null);
-	}
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/handler/ApplyLayoutHandlerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/handler/ApplyLayoutHandlerE4.java
index 22abc7cd2..f88e71829 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/handler/ApplyLayoutHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/e4/handler/ApplyLayoutHandlerE4.java
@@ -9,7 +9,7 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
-import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditorE4;
 
 /**
  * @author n.hoffmann
@@ -21,8 +21,8 @@ public class ApplyLayoutHandlerE4 extends AbstractHandler {
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		IEditorPart editor = HandlerUtil.getActiveEditor(event);
 
-		if(editor instanceof AbstractGraphKeyEditor){
-			((AbstractGraphKeyEditor) editor).applyLayout();
+		if(editor instanceof AbstractGraphKeyEditorE4){
+			((AbstractGraphKeyEditorE4) editor).applyLayout();
 		}
 
 		return null;
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/handler/ApplyLayoutHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/handler/ApplyLayoutHandler.java
deleted file mode 100644
index 3e8fd2aa3..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/handler/ApplyLayoutHandler.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 
- */
-package eu.etaxonomy.taxeditor.editor.key.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
-
-/**
- * @author n.hoffmann
- *
- */
-public class ApplyLayoutHandler extends AbstractHandler {
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IEditorPart editor = HandlerUtil.getActiveEditor(event);
-		
-		if(editor instanceof AbstractGraphKeyEditor){
-			((AbstractGraphKeyEditor) editor).applyLayout();
-		}
-		
-		return null;
-	}
-
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyGraphEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyGraphEditor.java
deleted file mode 100644
index 469727c24..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyGraphEditor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 
- */
-package eu.etaxonomy.taxeditor.editor.key.polytomous;
-
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
-import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
-
-/**
- * @author n.hoffmann
- * 
- */
-public class PolytomousKeyGraphEditor extends
-		AbstractGraphKeyEditor<PolytomousKey> implements
-		IPolytomousKeyEditorPage {
-
-	public static final String ID = "eu.etaxonomy.taxeditor.editor.key.polytomous.graph"; //$NON-NLS-1$
-	private final KeyEditor editor;
-
-	/**
-	 * @param keyEditor
-	 */
-	public PolytomousKeyGraphEditor(KeyEditor editor) {
-		this.editor = editor;
-	}
-	
-	@Override
-	public ConversationHolder getConversationHolder() {
-		return ((PolytomousKeyEditorInput) getEditorInput())
-				.getConversationHolder();
-	}
-
-	@Override
-	public PolytomousKey getKey() {
-		return ((PolytomousKeyEditorInput) getEditorInput()).getKey();
-	}
-
-	@Override
-	protected IBaseLabelProvider getLabelProvider() {
-		return new PolytomousKeyLabelProvider();
-	}
-
-	@Override
-	protected IContentProvider getContentProvider() {
-		return new PolytomousKeyGraphContentProvider();
-	}
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
index 4db8fd984..a9f643af5 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/e4/ConceptViewPartE4.java
@@ -24,7 +24,7 @@ import org.eclipse.swt.widgets.Composite;
 
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
-import eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor;
+import eu.etaxonomy.taxeditor.editor.key.e4.AbstractGraphKeyEditorE4;
 import eu.etaxonomy.taxeditor.editor.l10n.Messages;
 import eu.etaxonomy.taxeditor.editor.view.concept.ConceptContentProvider;
 import eu.etaxonomy.taxeditor.editor.view.concept.ConceptLabelProvider;
@@ -63,7 +63,7 @@ implements IPartContentHasDetails, IPartContentHasSupplementalData{
             // description selected in this view
             return;
         }
-		else if(partObject instanceof AbstractGraphKeyEditor){
+		else if(partObject instanceof AbstractGraphKeyEditorE4){
 			showEmptyPage();
 		}
 		else if(selection!=null){
