commit 8cb6dbf1e22b583463b322856c12d7de6c4b2159
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Fri May 4 15:54:51 2018 +0200

    ref #6913 Remove key editor

diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java
deleted file mode 100644
index 7d9d31841..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
- * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-
-package eu.etaxonomy.taxeditor.editor.key;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-import eu.etaxonomy.cdm.api.application.CdmApplicationState;
-import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
-import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
-import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
-import eu.etaxonomy.taxeditor.editor.l10n.Messages;
-import eu.etaxonomy.taxeditor.model.DataChangeBridge;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
-import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
-
-/**
- * @author n.hoffmann
- * @created Mar 30, 2011
- * @version 1.0
- */
-public class KeyEditor extends FormEditor implements IConversationEnabled,
-		IDirtyMarkable, IPartContentHasDetails, ICdmChangeListener {
-
-	public static final String ID = "eu.etaxonomy.taxeditor.editor.key"; //$NON-NLS-1$
-
-	private ConversationHolder conversation;
-
-	private boolean dirty;
-
-	private KeyEditorDataChangeBehaviour dataChangeBehavior;
-
-	private PolytomousKeyEditorInput polytomousKeyEditorInput;
-
-	/*
-     * (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 {
-        polytomousKeyEditorInput = (PolytomousKeyEditorInput)input;
-        CdmApplicationState.getCurrentDataChangeService().register(this);
-        super.init(site, input);
-    }
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.
-	 * IProgressMonitor)
-	 */
-	@Override
-	public void doSave(IProgressMonitor monitor) {
-		try {
-			monitor.beginTask(Messages.KeyEditor_SAVING, 1);
-			getConversationHolder().bind();
-			getConversationHolder().commit(true);
-			polytomousKeyEditorInput.merge();
-			setDirty(false);
-			monitor.worked(1);
-		} finally {
-			monitor.done();
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
-	 */
-	@Override
-	public void doSaveAs() {
-		// not allowed
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
-	 */
-	@Override
-	public boolean isSaveAsAllowed() {
-		return false;
-	}
-
-	@Override
-	public void setFocus() {
-		getConversationHolder().commit(true);
-		getConversationHolder().bind();
-		polytomousKeyEditorInput.bind();
-		super.setFocus();
-	}
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
-	 * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-	 */
-	@Override
-	public void update(CdmDataChangeMap map) {
-		if(dataChangeBehavior == null){
-			dataChangeBehavior = new KeyEditorDataChangeBehaviour(this);
-		}
-		DataChangeBridge.handleDataChange(map, dataChangeBehavior);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
-	 * ()
-	 */
-	@Override
-	public ConversationHolder getConversationHolder() {
-		return conversation;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see
-	 * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
-	 * java.lang.Object)
-	 */
-	@Override
-	public void changed(Object element) {
-	    if (element != null){
-	        editorDirtyStateChanged();
-	    }
-		IEditorPart activeEditor = getActiveEditor();
-		if (activeEditor instanceof IDirtyMarkable) {
-			((IDirtyMarkable) activeEditor).changed(element);
-		}
-	}
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
-     */
-    @Override
-    public void forceDirty() {
-        changed(null);
-    }
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.forms.editor.FormEditor#editorDirtyStateChanged()
-	 */
-	@Override
-	public void editorDirtyStateChanged() {
-		dirty = true;
-		super.editorDirtyStateChanged();
-	}
-
-	@Override
-	protected void handlePropertyChange(int propertyId) {
-		if (propertyId == PROP_DIRTY) {
-			setDirty(true);
-		}
-		super.handlePropertyChange(propertyId);
-	}
-
-	private void setDirty(boolean dirty) {
-		this.dirty = dirty;
-		firePropertyChange(PROP_DIRTY);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
-	 */
-	@Override
-	public boolean isDirty() {
-		return dirty;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
-	 */
-	@Override
-	public void dispose() {
-		conversation.unregisterForDataStoreChanges(this);
-		conversation.close();
-		polytomousKeyEditorInput.dispose();
-		CdmApplicationState.getCurrentDataChangeService().unregister(this);
-		super.dispose();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 *
-	 * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
-	 */
-	@Override
-	protected void addPages() {
-		conversation = polytomousKeyEditorInput.getConversationHolder();
-		conversation.registerForDataStoreChanges(this);
-
-//		try {
-//			addPage(0, new PolytomousKeyListEditor(this), polytomousKeyEditorInput);
-//			setPageText(0, Messages.KeyEditor_LIST);
-//			addPage(1, new PolytomousKeyGraphEditor(this), polytomousKeyEditorInput);
-//			setPageText(1, Messages.KeyEditor_GRAPH);
-//		} catch (PartInitException e) {
-//			MessagingUtils.error(getClass(), e);
-//		}
-
-
-
-		setPartName();
-
-	}
-
-	/**
-	 *
-	 */
-	public void setPartName() {
-		PolytomousKey key = polytomousKeyEditorInput.getKey();
-		setPartName(key.getTitleCache());
-	}
-
-    /* (non-Javadoc)
-     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
-     */
-    @Override
-    public void onChange(CdmChangeEvent event) {
-        editorDirtyStateChanged();
-        IEditorPart activeEditor = getActiveEditor();
-        if (activeEditor instanceof IDirtyMarkable) {
-            for(CdmBase cdmBase : event.getChangedObjects()) {
-                ((IDirtyMarkable) activeEditor).changed(cdmBase);
-            }
-        }
-    }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditorDataChangeBehaviour.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditorDataChangeBehaviour.java
deleted file mode 100644
index e46ff2a00..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditorDataChangeBehaviour.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.editor.key;
-
-import java.util.Vector;
-
-import eu.etaxonomy.cdm.model.description.PolytomousKey;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeEvent.EventType;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
-import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour;
-
-/**
- * @author n.hoffmann
- * @created May 5, 2011
- * @version 1.0
- */
-public class KeyEditorDataChangeBehaviour extends AbstractDataChangeBehaviour {
-
-	private final KeyEditor source;
-	private PolytomousKeyEditorInput input;
-
-	/**
-	 * @param keyEditor
-	 */
-	public KeyEditorDataChangeBehaviour(KeyEditor keyEditor) {
-		source = keyEditor;
-	}
-
-	/* (non-Javadoc)
-	 * @see eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour#reactOnDataChange(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
-	 */
-	@Override
-	public void reactOnDataChange(CdmDataChangeMap changeEvents) {
-		input = (PolytomousKeyEditorInput) source.getEditorInput();
-		
-		if(changeEvents.sizeByEventType(EventType.UPDATE) > 0){
-			reactOnUpdate(changeEvents.getEvents(EventType.UPDATE));
-		}
-	}
-
-	/** {@inheritDoc} */
-	@Override
-	public void reactOnUpdate(Vector<CdmDataChangeEvent> events){
-
-		for(CdmDataChangeEvent event : events){
-			
-			// update editor title
-			if(event.getEntity() instanceof PolytomousKey){
-				if(input.getKey().equals(event.getEntity())){
-					// set the name of the editor window
-					source.setPartName();
-				}
-			}
-		}
-	}
-}
