commit d8379b7bebfed5afbdfc639071ec9dedb0ec1f2c
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Fri May 4 15:48:22 2018 +0200

    ref #6913 Remove defined term editor

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java
deleted file mode 100644
index 61f1d7fd4..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDragListener.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
-* Copyright (C) 2009 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.definedterm;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.dnd.DragSourceAdapter;
-import org.eclipse.swt.dnd.DragSourceEvent;
-
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-
-/**
- * @author l.morris
- * @date 10 Jan 2012
- *
- */
-public class DefinedTermDragListener extends DragSourceAdapter {
-
-	private Viewer viewer;
-
-	public DefinedTermDragListener(Viewer viewer) {
-		this.viewer = viewer;
-	}
-
-	@Override
-	public void dragStart(DragSourceEvent event) {
-	    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
-	    List list = selection.toList();
-	    for (Object object : list) {
-            if(!(object instanceof DefinedTermBase)){
-                event.doit = false;
-                return;
-            }
-        }
-		event.doit = true;
-	}
-
-	@Override
-	public void dragSetData(DragSourceEvent event) {
-
-		IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
-		List<DefinedTermBase> definedTerms = new ArrayList<DefinedTermBase>();
-
-		for (Object object : selection.toList()){
-				definedTerms.add((DefinedTermBase)object);
-			}
-
-		if (TermTransfer.getInstance().isSupportedType(
-				event.dataType)) {
-			event.data = definedTerms.toArray(new DefinedTermBase[definedTerms.size()]);
-		}
-	}
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java
deleted file mode 100644
index e6baa874a..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermDropAdapter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
-* Copyright (C) 2009 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.definedterm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.TransferData;
-
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.OrderedTermBase;
-import eu.etaxonomy.cdm.model.common.TermBase;
-import eu.etaxonomy.taxeditor.editor.definedterm.operation.MoveDefinedTermOperation;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
-
-/**
- * @author l.morris
- * @date 10 Jan 2012
- *
- */
-public class DefinedTermDropAdapter extends ViewerDropAdapter {
-
-	private final DefinedTermEditor editor;
-	/**
-	 * @param viewer
-	 */
-	protected DefinedTermDropAdapter(DefinedTermEditor editor) {
-		super(editor.getViewer());
-		this.editor = editor;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
-	 */
-	@Override
-	public boolean performDrop(Object data) {
-
-		TermBase target = (TermBase) getCurrentTarget();//can be vocab
-		int currentLocation = getCurrentLocation();
-		//DefinedTermBase[] droppedElements = (DefinedTermBase[]) data;
-		Object[] droppedTerms = (Object[]) data;
-		Collection<DefinedTermBase> sourceTerms = new ArrayList<DefinedTermBase>(); //Arrays.asList(droppedElements)
-
-		for (Object droppedTerm : droppedTerms) {
-
-			DefinedTermBase term = (DefinedTermBase) droppedTerm;
-			sourceTerms.add(term);
-
-		}
-
-		AbstractPostOperation operation = new MoveDefinedTermOperation("Move Descriptions",
-		        StoreUtil.getUndoContext(),
-		        target,
-		        sourceTerms,
-		        editor,
-		        currentLocation);
-		//TODO: implement execute
-//		StoreUtil.executeOperation(operation);
-		// select the newly moved objects
-		editor.getViewer().setSelection(new StructuredSelection(sourceTerms.toArray(new TermBase[sourceTerms.size()])));
-
-		return true;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
-	 */
-	@Override
-	public boolean validateDrop(Object target, int operation,
-			TransferData transferType) {
-		boolean transferDataIsSupported = TermTransfer.getInstance().isSupportedType(transferType);
-		// maybe don't need this - they will be all TermBase anyway
-		return target instanceof TermBase && transferDataIsSupported;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
-	 */
-	@Override
-	public void dragOver(DropTargetEvent event) {
-	    super.dragOver(event);
-	    TermBase target = (TermBase) getCurrentTarget();
-	    if(!(target instanceof OrderedTermBase)) {
-	        // this is to only disable insert between items
-	        event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL;
-	    }
-
-
-	}
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
deleted file mode 100644
index 4c2a95689..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermEditor.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
- * Copyright (C) 2009 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.definedterm;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-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.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.EditorPart;
-
-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.common.OrderedTermBase;
-import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
-import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;
-import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-
-/**
- * @author l.morris
- * @date 3 Jan 2012
- *
- */
-public class DefinedTermEditor extends EditorPart implements IConversationEnabled, ISelectionListener, IDirtyMarkable, IPostOperationEnabled {
-
-	public static final String ID = "eu.etaxonomy.taxeditor.editor.definedTerm";
-
-	public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor";
-
-	protected TreeViewer viewer;
-	protected ConversationHolder conversation;
-	private ISelectionService selectionService;
-	private boolean dirty;
-
-
-	private final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE;
-	/**
-	 *
-	 */
-	public DefinedTermEditor() {
-		super();
-		conversation = CdmStore.createConversation();
-	}
-
-	@Override
-	public void createPartControl(Composite parent) {
-
-	//		parent.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
-
-			FillLayout layout = new FillLayout();
-			layout.marginHeight = 0;
-			layout.marginWidth = 0;
-			layout.type = SWT.VERTICAL;
-
-			parent.setLayout(layout);
-			viewer = new TreeViewer(parent);
-			viewer.getControl().setLayoutData(LayoutConstants.FILL());
-			viewer.setContentProvider(new TermContentProvider());
-			viewer.setLabelProvider(new TermLabelProvider());
-			viewer.setSorter(new DefinedTermSorter());
-
-			Transfer[] transfers = new Transfer[] { TermTransfer.getInstance() };
-			viewer.addDragSupport(dndOperations, transfers, new DefinedTermDragListener(viewer));
-			viewer.addDropSupport(dndOperations, transfers, new DefinedTermDropAdapter(this));
-
-			getDefinedTermEditorInput().initialiseVocabularies();
-			viewer.setInput(getDefinedTermEditorInput().getVocabularies());
-
-			getSite().setSelectionProvider(viewer);
-
-			selectionService = getSite().getWorkbenchWindow().getSelectionService();
-			selectionService.addSelectionListener(this);
-
-			setPartName(getEditorInput().getName());
-			createMenu();
-		}
-
-
-
-
-	/**
-	 *
-	 */
-	public TermEditorInput getDefinedTermEditorInput() {
-		return (TermEditorInput) getEditorInput();
-	}
-
-	/* (non-Javadoc)
-	 * @see eu.etaxonomy.taxeditor.operation.IPostOperationEnabled#postOperation(eu.etaxonomy.cdm.model.common.CdmBase)
-	 */
-	@Override
-	public boolean postOperation(CdmBase objectAffectedByOperation) {
-
-
-		viewer.refresh();
-
-		if(objectAffectedByOperation != null){
-			viewer.setSelection(new StructuredSelection(objectAffectedByOperation));
-		}
-		setDirty(true);
-
-		return true;
-	}
-
-	private void createMenu() {
-		// register context menu
-		MenuManager menuManager = new MenuManager();
-		menuManager
-				.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-		getSite().registerContextMenu(ID, menuManager, viewer);
-
-		Control control = viewer.getControl();
-		Menu menu = menuManager.createContextMenu(control);
-		menuManager.setRemoveAllWhenShown(true);
-		control.setMenu(menu);
-	}
-
-
-
-
-	@Override
-	public void doSave(IProgressMonitor monitor) {
-		getConversationHolder().commit();
-		getDefinedTermEditorInput().merge();
-		setDirty(false);
-		getDefinedTermEditorInput().initialiseVocabularies();
-		viewer.refresh();
-	}
-
-
-	@Override
-	public void doSaveAs() {}
-
-	@Override
-	public void init(IEditorSite site, IEditorInput input) throws PartInitException {
-		setSite(site);
-		setInput(input);
-
-	}
-
-	@Override
-	public boolean isDirty() {
-		return dirty;
-	}
-
-	@Override
-	public boolean isSaveAsAllowed() {
-		return false;
-	}
-
-	@Override
-	public void setFocus() {
-	    viewer.getControl().setFocus();
-		getConversationHolder().bind();
-		getDefinedTermEditorInput().bind();
-	}
-
-	@Override
-	public void update(CdmDataChangeMap changeEvents) {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public ConversationHolder getConversationHolder() {
-		return conversation;
-	}
-
-	@Override
-	public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public void changed(Object element) {
-		dirty = true;
-		setDirty(true);
-		viewer.update(element, null);
-	}
-
-	/* (non-Javadoc)
-	 * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
-	 */
-	@Override
-	public void forceDirty() {
-	    changed(null);
-	}
-
-	/**
-	 * @param dirty the dirty to set
-	 */
-	public void setDirty(boolean dirty) {
-		this.dirty = dirty;
-		firePropertyChange(PROP_DIRTY);
-	}
-
-	@Override
-	public boolean onComplete() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	/**
-	 *
-	 */
-	public TreeViewer getViewer() {
-		return viewer;
-	}
-
-	private class DefinedTermSorter extends ViewerSorter {
-
-	    @Override
-	    public int compare(Viewer viewer, Object e1, Object e2) {
-	        // the comparison value in this method determines the
-	        // location <-> add term method used in the MoveDefinedTermOperation
-	        // execute call
-	        if(e1 instanceof OrderedTermBase && e2 instanceof OrderedTermBase) {
-	            OrderedTermBase otbe1 = (OrderedTermBase)e1;
-	            OrderedTermBase otbe2 = (OrderedTermBase)e2;
-	            if(otbe1.getOrderIndex() == otbe2.getOrderIndex()) {
-	                return 0;
-	            } else if (otbe1.getOrderIndex() < otbe2.getOrderIndex()){
-	            	return -1;
-	            } else{
-	            	return 1;
-	            }
-	        } else {
-	            return super.compare(viewer, e1, e2);
-	        }
-	    }
-	}
-
-	@Override
-	public void dispose() {
-	    getDefinedTermEditorInput().dispose();
-	    super.dispose();
-	}
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
deleted file mode 100644
index 25d62803b..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/DefinedTermMenu.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
-* Copyright (C) 2009 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.definedterm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.menus.CommandContributionItem;
-import org.eclipse.ui.menus.CommandContributionItemParameter;
-
-import eu.etaxonomy.cdm.model.common.TermType;
-import eu.etaxonomy.taxeditor.l10n.Messages;
-import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * Menu used in the store plugin xml to dynamically generate menu (sub-menu) contribution items
- * for term types which when clicked open the defined term editor for the chosen term type
- *
- * @author pplitzner
- * @date 21 Jul 2015
- *
- */
-
-public class DefinedTermMenu extends CompoundContributionItem {
-
-
-    @Override
-    protected IContributionItem[] getContributionItems() {
-        Collection<IContributionItem> items = new ArrayList<IContributionItem>();
-        if(CdmStore.isActive()){
-            MenuManager dtMenuManager =
-                    new MenuManager(Messages.DefinedTermMenu_TERM_EDITOR,"eu.etaxonomy.taxeditor.store.definedTermEditorMenu"); //$NON-NLS-2$
-
-            dtMenuManager.setVisible(true);
-
-            items.add(dtMenuManager);
-            //add Feature and NamedArea to top level
-            dtMenuManager.add(addChildTermsToMenuManager(TermType.Feature));
-            dtMenuManager.add(addChildTermsToMenuManager(TermType.NamedArea));
-            dtMenuManager.add(new Separator());
-
-            MenuManager otherMenuManager =
-                    new MenuManager(Messages.DefinedTermMenu_OTHERS,"eu.etaxonomy.taxeditor.store.term.other.menu"); //$NON-NLS-2$
-            otherMenuManager.setVisible(true);
-            dtMenuManager.add(otherMenuManager);
-            dtMenuManager.add(new Separator());
-            dtMenuManager.add(createFeatureTreeMenuItem());
-
-            List<TermType> ttList = new ArrayList<TermType>(EnumSet.allOf(TermType.class));
-            Collections.sort(ttList,new SortByTermTypeMessage());
-            for (TermType tt : ttList)
-            {
-                //skip Feature and NamedArea as they have already been added to top level
-                if(tt.equals(TermType.Feature) || tt.equals(TermType.NamedArea)){
-                    continue;
-                }
-                // if term type has a parent, do not add it
-                // it will be added in the recursive call
-                if(tt.getKindOf() == null) {
-                    IContributionItem ici = addChildTermsToMenuManager(tt);
-                    if(ici != null) {
-                        otherMenuManager.add(ici);
-                    }
-                }
-            }
-        }
-	    return items.toArray(new IContributionItem[]{});
-	}
-
-	private IContributionItem addChildTermsToMenuManager(TermType termType) {
-
-		//FIXME : need a better way to find out if a term type can be editable (ticket 3853)
-		if(termType.getEmptyDefinedTermBase() != null) {
-			Set<TermType> children = termType.getGeneralizationOf();
-			// term type has no children, so create menu item
-			if(children.isEmpty()) {
-				return createMenuItem(termType);
-			}
-			// term type has children, so create sub menu
-			MenuManager dtMenuManager =
-					new MenuManager(termType.getMessage(PreferencesUtil.getGlobalLanguage()),"eu.etaxonomy.taxeditor.store." + termType.getKey() + Messages.DefinedTermMenu_MENU); //$NON-NLS-1$
-			dtMenuManager.setVisible(true);
-			dtMenuManager.add(createDefaultMenuItem(termType));
-
-			Separator sep = new Separator();
-			dtMenuManager.add(sep);
-			// add child items to the sub menu
-			for(TermType tt : children) {
-				IContributionItem item = addChildTermsToMenuManager(tt);
-				if(item != null) {
-					dtMenuManager.add(item);
-				}
-			}
-			return dtMenuManager;
-		} else {
-			return null;
-		}
-
-	}
-
-	private CommandContributionItem createMenuItem(TermType termType) {
-
-		Map<String, String> params = new HashMap<String, String>();
-		params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid", //$NON-NLS-1$
-				termType.getUuid().toString());
-
-        CommandContributionItemParameter p = new CommandContributionItemParameter(
-                PlatformUI.getWorkbench(),
-                "", //$NON-NLS-1$
-                "eu.etaxonomy.taxeditor.store.openDefinedTermEditor", //$NON-NLS-1$
-                params,
-                null,
-                null,
-                null,
-                termType.getMessage(),
-                "", //$NON-NLS-1$
-                "", //$NON-NLS-1$
-                SWT.PUSH,
-                "", //$NON-NLS-1$
-                true);
-
-        CommandContributionItem item = new CommandContributionItem(p);
-        return item;
-
-	}
-
-	private CommandContributionItem createFeatureTreeMenuItem() {
-
-		Map<String, String> params = new HashMap<String, String>();
-		params.put("eu.etaxonomy.taxeditor.workbench.commandparameter.partName", //$NON-NLS-1$
-				"eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditor"); //$NON-NLS-1$
-
-        CommandContributionItemParameter p = new CommandContributionItemParameter(
-                PlatformUI.getWorkbench(),
-                "eu.etaxonomy.taxeditor.featuretree.commandContributionItemParameter", //$NON-NLS-1$
-                "eu.etaxonomy.taxeditor.command.openPart", //$NON-NLS-1$
-                params,
-                null,
-                null,
-                null,
-                Messages.DefinedTermMenu_FEATURE_TREE,
-                "", //$NON-NLS-1$
-                "", //$NON-NLS-1$
-                SWT.PUSH,
-                "", //$NON-NLS-1$
-                true);
-
-
-
-        CommandContributionItem item = new CommandContributionItem(p);
-        return item;
-
-	}
-
-	private CommandContributionItem createDefaultMenuItem(TermType termType) {
-
-	    Map<String, String> params = new HashMap<String, String>();
-	    params.put("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid", //$NON-NLS-1$
-	            termType.getUuid().toString());
-
-	    CommandContributionItemParameter p = new CommandContributionItemParameter(
-	            PlatformUI.getWorkbench(),
-	            "", //$NON-NLS-1$
-	            "eu.etaxonomy.taxeditor.store.openDefinedTermEditor", //$NON-NLS-1$
-	            params,
-	            null,
-	            null,
-	            null,
-	            String.format(Messages.DefinedTermMenu_OTHER_S, termType.getMessage()),
-	            "", //$NON-NLS-1$
-	            "", //$NON-NLS-1$
-	            SWT.PUSH,
-	            "", //$NON-NLS-1$
-	            true);
-
-
-
-	    CommandContributionItem item = new CommandContributionItem(p);
-	    return item;
-
-	}
-
-	private class SortByTermTypeMessage implements Comparator<TermType> {
-	    @Override
-        public int compare(TermType t1, TermType t2) {
-	        if (t1.equals(t2)){
-	            return 0;
-	        }
-	        int result = t1.getMessage().compareTo(t2.getMessage());
-	        if (result == 0){
-	            return t1.compareTo(t2);
-	        }
-	        return result;
-	    }
-	}
-
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateDefinedTermHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateDefinedTermHandler.java
deleted file mode 100644
index 3f9424753..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateDefinedTermHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (C) 2009 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.definedterm.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.common.TermBase;
-import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
-import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateDefinedTermOperation;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
-
-/**
- * @author l.morris
- * @date 21 Dec 2011
- *
- */
-public class CreateDefinedTermHandler extends AbstractHandler {
-
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-	    boolean addTermAsKindOf =
-	            event.getCommand().getId().equals("eu.etaxonomy.taxeditor.editor.definedTerms.newKindOfTerm")?true:false;
-
-		IPostOperationEnabled editor = (IPostOperationEnabled) HandlerUtil
-				.getActiveEditor(event);
-
-		if (editor instanceof DefinedTermEditor){
-			DefinedTermEditor dfe = (DefinedTermEditor) editor;
-			IStructuredSelection selection = (IStructuredSelection) HandlerUtil
-					.getCurrentSelection(event);
-			if (selection.getFirstElement() instanceof TermBase) {
-				try {
-					String label = event.getCommand().getName();
-					IUndoContext undoContext = StoreUtil.getUndoContext();
-
-					TermBase termBase = (TermBase) selection.getFirstElement();
-
-					AbstractPostOperation operation =
-							new CreateDefinedTermOperation(label,
-									undoContext,
-									termBase,
-									dfe.getDefinedTermEditorInput(),
-									editor, addTermAsKindOf);
-
-				} catch (NotDefinedException e) {
-					MessagingUtils.error(getClass(), e);
-				}
-			}
-		}
-
-		return null;
-	}
-
-	}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateTermVocabularyHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateTermVocabularyHandler.java
deleted file mode 100644
index 623cf3772..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/CreateTermVocabularyHandler.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
-* Copyright (C) 2009 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.definedterm.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
-import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateTermVocabularyOperation;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
-
-/**
- * @author l.morris
- * @date 21 Dec 2011
- *
- */
-public class CreateTermVocabularyHandler extends AbstractHandler implements
-		IHandler {
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IPostOperationEnabled editor = (IPostOperationEnabled) HandlerUtil
-				.getActiveEditor(event);
-
-		if (editor instanceof DefinedTermEditor){
-			DefinedTermEditor dfe = (DefinedTermEditor) editor;
-
-			try {
-				String label = event.getCommand().getName();
-				IUndoContext undoContext = StoreUtil.getUndoContext();
-
-				AbstractPostOperation operation =
-						new CreateTermVocabularyOperation(label,
-								undoContext,
-								dfe.getDefinedTermEditorInput(),
-								editor);
-
-			} catch (NotDefinedException e) {
-				MessagingUtils.error(getClass(), e);
-			}
-		}
-		return null;
-	}
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java
deleted file mode 100644
index 31fc65028..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/DeleteTermBaseHandler.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
-* Copyright (C) 2009 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.definedterm.handler;
-
-import java.util.Iterator;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.common.TermBase;
-import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;
-import eu.etaxonomy.taxeditor.editor.definedterm.operation.DeleteTermBaseOperation;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
-
-/**
- * @author l.morris
- * @date 22 Dec 2011
- *
- */
-public class DeleteTermBaseHandler extends AbstractHandler {
-
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IEditorPart editor = HandlerUtil
-				.getActiveEditor(event);
-
-		if (editor.isDirty()){
-			boolean proceed = MessageDialog.openQuestion(null,
-					"Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
-			if (proceed) {
-				editor.doSave(null);
-			} else {
-				return null;
-			}
-		}
-		if (editor instanceof DefinedTermEditor){
-		    DefinedTermEditor dfe = (DefinedTermEditor) editor;
-		    try {
-		        String label = event.getCommand().getName();
-		        IUndoContext undoContext = StoreUtil.getUndoContext();
-
-		        ISelection selection = dfe.getViewer().getSelection();
-		        if(selection instanceof IStructuredSelection){
-
-		            Iterator<TermBase> selectionIterator = ((IStructuredSelection) selection).iterator();
-
-		            while (selectionIterator.hasNext()){
-
-		                TermBase term = selectionIterator.next();
-
-
-		                AbstractPostOperation operation =
-		                        new DeleteTermBaseOperation(label,
-		                                undoContext,
-		                                term,
-		                                dfe.getDefinedTermEditorInput(),
-		                                dfe);
-		            }
-		        }
-		    } catch (NotDefinedException e) {
-		        MessagingUtils.error(getClass(), e);
-		    }
-		}
-		return null;
-	}
-
-}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermEditorHandler.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermEditorHandler.java
deleted file mode 100644
index e79eaeb92..000000000
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/handler/OpenDefinedTermEditorHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright (C) 2009 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.definedterm.handler;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-
-
-/**
- * @author l.morris
- * @date 8 Dec 2011
- *
- */
-public class OpenDefinedTermEditorHandler extends AbstractHandler implements IHandler {
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-
-//		String termTypeUuid = event.getParameter("eu.etaxonomy.taxeditor.store.openDefinedTermEditor.termTypeUuid");
-//		IWorkbenchPage activePage = StoreUtil.getActivePage();
-//		try {
-//			activePage.openEditor(new TermEditorInput(TermType.getByUuid(UUID.fromString(termTypeUuid))), DefinedTermEditor.ID);
-//		} catch (PartInitException e) {
-//
-//			String PID = "eu.etaxonomy.taxeditor.application";
-//			MultiStatus info = new MultiStatus(PID, 1, "You might be missing sufficient permissions to open the Defined Term Editor", null);
-//			info.add(new Status(IStatus.WARNING, PID, 1, e.getMessage(), null));
-//			MessagingUtils.warningDialog("Cannot open Defined Term Editor", getClass(), info);
-//		}
-
-		return null;
-	}
-
-}
